VOGONS


First post, by keenerb

User metadata
Rank Oldbie
Rank
Oldbie

C:\SET SOMEVAR=1
C:\ECHO %SOMEVAR%
%SOMEVAR%

C:\

Is this even possible in old DOS versions?

Reply 1 of 2, by jakethompson1

User metadata
Rank Oldbie
Rank
Oldbie

Are you actually doing it from a .BAT file or from the prompt? It will work from inside the .BAT file. If I remember right, the % notation working at the interactive prompt wasn't added until Windows 95 (possibly for better compatibility with NT cmd?)

Reply 2 of 2, by Gmlb256

User metadata
Rank l33t
Rank
l33t

A way to check every DOS environment set is just to type SET.

You can use the MORE command like this in case there are too many:

SET | MORE

So it would prompt you to press a key to continue if the height of the screen gets exceeded.

If MORE is not available then you can use ECHO to output the information into a file:

SET > ENV.TXT

For batch files you could use something like this:

IF "%SOMEVAR%"=="1" ECHO SOMEVAR IS SET
IF "%SOMEVAR%"=="0" ECHO SOMEVAR IS NOT SET