Domanda

I use a lot of computers at Uni and about, and as such, I use portable programs to do so. For my own curiosity and ease of use, I want to be able to open a file with a program that is not installed on the computer, from my usb. -This is what ive compiled thus far.

@ECHO OFF
start "%cd:~0,3%PortableApps\MnemosynePortable\MnemosynePortable.exe" "%cd:~0,3%Documents\Dropbox\Folders\UNIVERSITY\University\Mnemosyne\2013-SEM1.db"

The problem is, '.db' extension is not registered to work with 'MnemosynePortable.exe'.

Can someone assist?

edit missing quotation marks after start, for future reference

È stato utile?

Soluzione

I'm not convinced of your analysis of your problem.

What stands out is that your command line is not balanced - the program-name has no opening quote.

Next issue is that the start syntax will interpret such a line as a window-name followed by "...-sem1.db" - and that is what it can't associate.

So - Easy solution is to add a pair of rabbits' ears around your desired window-name, and then another to balance the single enclosing the executable name.

start "your window name - may be empty" "%cd....

OR - since the executable-name does not contain spaces, remove the quote after .exe

start %cd....table.exe "%cd...sem1.db"

Either should cure your problem. Personally, I'd choose the first.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top