Starting with version 2015.10.01, vDos uses a special technique for importing environment variables from Windows into the vDos command processor (now 4DOS.COM).

If you want to use a Windows environment variable (for example, %systemroot% or %homedrive%) in vDos you must first explicitly declare it, either in autoexec.txt, in another batch file, or at the command line. The Windows variable must be surrounded by two percent signs on each side:

set vdosvar=%%windowsvar%%

For example, before you can use %systemroot% in vDos, you must first declare it:

set systemroot=%%systemroot%%

You can then use %systemroot% in vDos in place of the system drive.

Versions of vDos up to and including 2015.04.10 can use Windows variables in the normal way (for example, %systemroot%) without declaring them in advance. The instructions above apply only to version 2015.10.01 and later.

Environment variables for use in vDos may of course be declared in autoexec.txt using the same technique used in DOS and the Windows command prompt:

set myvar=ContentOfMyVar
 

Last edit: Edward Mendelson 2015-10-25