Environment (PBYTE)
This parameter may be used for independent or related DosStartSession functions.
When the Environment field is 0, the program in the new session inherits the environment of the Shell if the InheritOpt field is equal to SSF_INHERTOPT_SHELL, or the environment of the program issuing DosStartSession if the InheritOpt field is equal to SSF_INHERTOPT_PARENT.
DOS Sessions
By default, the DOS session processes the AUTOEXEC.BAT file on the DOS startup drive. Environment variables may be set in the AUTOEXEC.BAT file or by specifying them via this parameter. Any setting available from the DOS setting notebook may also be set here. For instance, to have D:\MYEXEC.BAT run instead of AUTOEXEC.BAT, enable direct access to the hardware timer, disable the break key, and set the real memory size to 256K, specify the environment string as:
myenv = "DOS_AUTOEXEC=D:\\MYEXEC.BAT\0HW_TIMER=1\0DOS_BREAK=0\0DOS_RMSIZE=256\0";
See the pEnv parameter in DosExecPgm for additional information about environment settings.