VOGONS


SET command doesn't work

Topic actions

First post, by V@no

User metadata
Rank Newbie
Rank
Newbie

Hello.

Does someone know why the SET command does not set variables?

I'm running DOSBox 0.74 on Windows 7 x64

Z:\>SET blah=test
Z:\>echo %blah%
%blah%
Z:\>

What expected is this:

Z:\>SET blah=test
Z:\>echo %blah%
test
Z:\>

Any ideas?

Thank you.

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The SET command works. You'll see your variables listed (amongst others) when you use the SET command with no parameter.

Z:\>SET blah=test
Z:\>SET
BLAH=test

However, variables do not work in commands typed at the prompt, they only work in batch files. This is consistent with MS-DOS. It's true that variables work in commands typed at the prompt in the Windows Command Shell; but DOSBox emulates DOS, not Windows.

FYI, the 4DOS command shell offers enhanced functionality, including variables in typed commands.

Reply 2 of 4, by V@no

User metadata
Rank Newbie
Rank
Newbie
ripsaw8080 wrote:

However, variables do indeed not work in typed commands, they only work in batch files. This is consistent with MS-DOS. It's true that variables work in commands typed at the prompt in the Windows Command Shell; but DOSBox emulates DOS, not Windows.

So what can I do when .bat contains:

SET ACAD=E:\ACAD\SUPPORT;E:\ACAD\FONTS;E:\ACAD\ADS
SET ACADCFG=E:\ACAD
SET ACADDRV=E:\ACAD\DRV
E:\ACAD\ACAD.exe %1 %2

but acad.exe doesn't see these variables?

Thanks.

Reply 3 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

I was referring to your use of variable substitution (e.g. %blah%) in commands; that only works in batch files. Environment variables should be visible to programs. Are you certain the program isn't seeing the variables? DOSBox is intended for games, not applications, and it's possible there is some issue with the app in question. You can try booting real DOS in DOSBox to see if that helps.

Reply 4 of 4, by V@no

User metadata
Rank Newbie
Rank
Newbie

Oh my...it actually works just fine, dumb me.
I first configured the program to run from C:\ drive, then moved it to E:\ and forgot to reconfigure it again, it was trying load drivers from C:\

Sorry for wasting your time...