Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: DOS environment variables RunEnviron winset envars.exe
There is a Microsoft utility that can be used to set a global DOS variable in Windows 95. The utility is called "WinSet" and it's in a self-extracting archive file named "envars.exe". It's used almost identically to the DOS Set command, except it changes the master DOS environment in Windows 95.
If it is a DOS program under 32 bit Windows, one trick is to pass parameters to a BAT file that sets the environment variable THEN runs the DOS program (in the SAME bat file)
To run DOS applications from WinBatch and to alter the path for DOS programs, you'll need to set up a batch file, and launch it with the WIL Run command.
Assuming the case where one wished to run "command.com" with the path "c:\special", a batch file as shown below will work, along with passing all the information required as parameters in the WIL Run command:
rem DOPATH.BAT file SET PATH=%1 ECHO %PATH% PAUSE rem The following line runs whatever DOS exe you want, followed by params: %2 %3 %4 %5 %6 %7 %8 %9WIL Run Command:
Run("dopath.bat", "c:\special command.com")As long as your environment size is large enough, this should work fine. Also take a look at your PIF settings for setting the environment space.
If your App is a DOS App, then the EnvironSet command will not show up in the DOS environment, so that is why you cannot use the EnvironSet function to set DOS environment variables. (Windows keep two copies of the environment, one for DOS and one for Windows)
The RunEnviron function CAN ONLY SET THE ENVIRONMENT AND RUN WINDOWS PROGRAMS. IT CANNOT RUN DOS PROGRAMS.
Article ID: W12915
Filename: DOS Environment Variables.txt
File Created: 1999:04:15:16:50:30
Last Updated: 1999:04:15:16:50:30