VOGONS

Common searches


Quotes hell

Topic actions

First post, by RrnR

User metadata
Rank Newbie
Rank
Newbie

I have this command for invoking DOSBox

 "%DBEXE%" -userconf  ^
-c "mount c c:\" ^
-c "path=C:\projects\tools;C:\projects\toolsrc" ^
-c C: ^
-c "cd %CD%" ^
-c "%*"

The carets are DOS batch continuation lines. %DBEXE% points to the DOSBox.exe executable.

DOSBox starts OK - the unravelled command becomes:

C:\Projects>"C:\Program Files\DOSBox 0.74\DOSBox.exe" -userconf      -c "mount c c:\"     -c "path=C:\projects\tools;C:\projects\toolsrc"     -c C:     -c "cd C:\Projects\Monitor\DTR"

but this is what I get in the DOSBox window as the commands run:

Z:>SET BLASTER=A220 I7 D1 H5 T6

Z:>mount c c:" -c
Drive C is mounted as local directory C:"\

Z:>C:

C:\CD C:\Projects
Unable to change to C:\Projects

It is no doubt related to quoting but I cannot get it to work. The mount command is wrong for a start (look at the command line - local directory C:"\ ?) - I have a C: drive of sorts mounted but I can't see any files on it, so the mount command didn't work.

What are the rules for quoting parameters?

Reply 1 of 3, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

Try using "mount c c:\\", with two backslashes. It looks like whatever you're using is interpreting backslashes as an escape character. You might have to use double backslashes everywhere else, too. Alternatively, I think forward slashes might work, but I can't remember.

Alternatively, mount some folder other than C:\ as drive C. Generally mounting C:\ as drive C is ill-advised anyway, as it risks allowing some badly behaved DOS program to do horrible things to your system. (That is kind of unlikely, though.)

Reply 2 of 3, by RrnR

User metadata
Rank Newbie
Rank
Newbie

Two backslashes didn't work, one forward slash did. Strange that the CD command doesn't need that syntax, but I guess its because the mount command is a "special" i.e. not handled by the same command processor that the DOS internal commands are handled by.

Thanks for your help.

Reply 3 of 3, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

It seems to me there is at least one genuine bug here.

mount c c:

typed in DOSBox brings up a "Directory c: doesn't exist" message.

There's really no reason

mount c c:"

should do anything different, but there it is. It even does its thing in SVN. Maybe no one has tried to type that before! Does anyone know what's going on here?