VOGONS


First post, by emjtech

User metadata
Rank Newbie
Rank
Newbie

Hi
Sometimes I need to use a very special and old editor on DOS
I use DOSbox in Windows 7.
If I use the following command on the shortcut :
D:\DOSBox\DOSBox.exe -userconf -conf D:\DOSBox\DOSBox-MEDIT.conf -c "MEDIT.exe N:\CAEdraw\CAEcmp.DAT"
It works perfectly , running MEDIT.exe with its file to edit N:\CAEdraw\CAEcmp.DAT

However if I use the following command on the shortcut to allow Drag&Drop :
D:\DOSBox\DOSBox.exe -userconf -conf D:\DOSBox\DOSBox-MEDIT.conf -c "MEDIT.exe %1"

DOSbox runs MEDIT.exe without parameters and then try to mount N:\CAEdraw and to run CAEcmp.DAT resulting in the following:

Mount C "N:\CAEdraw"
Illegal command: MOUNT.
C:
CAECMP.DAT
Illegal command: CAECMP.DAT

Running a batch file with the lines :
echo D:\DOSBox\DOSBox.exe -userconf -conf D:\DOSBox\DOSBox-MEDIT.conf -c "MEDIT.exe %1"
pause

Prints
D:\DOSBox\DOSBox.exe -userconf -conf D:\DOSBox\DOSBox-MEDIT.conf -c "MEDIT.exe N:\CAEdraw\CAEcmp.DAT"

(maybe some invisible characters?)
...
What I am doing wrong?

Reply 1 of 2, by emjtech

User metadata
Rank Newbie
Rank
Newbie

I found a quick and dirty solution:
I made a Shortcut to a batch file:
Test.BAT

In the batch file typed the line:
D:\DOSBox\DOSBox.exe -userconf -conf D:\DOSBox\DOSBox-MEDIT.conf -c "MEDIT.exe %1"

This works...
But still I don't understand why it doesn't work on the "Target" line on the shortcut to DOSbox itself

Someone can explain this to me?

Reply 2 of 2, by Malvineous

User metadata
Rank Oldbie
Rank
Oldbie

According to this result from Google you can't use %1 in a shortcut.

This means DOSBox is seeing two commands - the first is "MEDIT.exe" (DOSBox replaces the %1 with a blank), and the second command is the file you dropped onto the shortcut, which is apparently appended to the filename automatically. This is why DOSBox tries to run the dropped file.

When you made the shortcut to the .bat file instead, the %1 works as expected, because the dropped filename is passed as the .bat file's first parameter.

It looks like you may have to stick with a .bat file, because it looks like shortcuts can only have the dropped filename added at the end of the command line, which means you can't surround it by double-quotes.