vDosPlus Advanced Tips

To make things easier for people to use vDosPlus, I am trying to collect various vDosPlus advanced tips in this page. You may find these information useful and handy. Some tips here contain the information written by users like Edward Mendelson and Carl Distefano.

1. Windows environment variables in vDosPlus

If you want to use a Windows environment variable (e.g. %SYSTEMROOT% or %HOMEDRIVE%) in vDosPlus 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:


For example, before you can use %SYSTEMROOT% in vDosPlus, you must first declare it:


You can then use %SYSTEMROOT% in vDosPlus in place of the system drive.

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


In fact, you are strongly recommended to set an environment variable named %TEMP% that points to a temporary directory, possibly in the same location as the Windows temporary directory (especially when USEDRVS=ON is set to automatically use the same Windows drive letters in vDosPlus).

2. Using file names in a long filename environment

vDosPlus is a DOS emulator for Windows, which may map to actual Windows drives in its emulated DOS environment with its "USE" command. However, while Windows allows file names up to 255 characters, traditional DOS file names only allow up to 11 characters, with the first 8 characters as its main file name, and the last 3 characters as its extension. This is known as the short or 8.3 file names, in contrast to the Windows long filenames or LFNs. For example, "C:\Program Files" is a directory commonly seen in Windows, and it generally has a corresponding DOS 8.3 name called "C:\PROGRA~1". If there is also another Windows path named for example "C:\ProgramData", it probably has a corresponding DOS 8.3 name named "C:\PROGRA~2". In both real DOS environments or under DOS emulators such as DOSBox, "C:\PROGRA~1" and "C:\PROGRA~2" (or even "C:\Program Files" and "C:\ProgramData" if LFNs are enabled) will be seen using directory listing commands such as DIR. The DIR command in vDosPlus will display Windows-style long file names to the right of the DOS 8.3 names, similar to a Windows 9x DOS prompt or a real MS-DOS 7.10 environment with the DOSLFN driver installed. With this users will be able to find long filenames (as displayed in Windows) corresponding to their respective DOS 8.3 names easily.

Apart from its built-in 4DOS 8.00 shell and the internal non-4DOS shell, both of which support Windows-style long filenames, there are also many LFN-aware applications under DOS such as MS-DOS 7 EDIT, which will be able to see and operate with both the long filenames and their corresponding DOS 8.3 names. PKZIP/PKUNZIP 2.50, QuickView Pro 2.61, MPXPLAY and Doszip Commander are some other such examples (you can see even more examples at http://www.cn-dos.net/msdos71/doslfns.htm). Since vDosPlus provides supports for long filename functions, these programs will be able to see and operate with Windows-style long filenames (in addition to DOS 8.3 names) in vDosPlus directly. However, older DOS programs generally don't support Windows-style long filenames. Microsoft Word for DOS, Microsoft QBASIC and PKZIP/PKUNZIP 2.04 are such examples, which will only be able to see and operate with DOS 8.3 names. In such cases users must provide the corresponding DOS 8.3 names to them as their inputs. If a newer version of such a program is available which supports long filenames (e.g. PKZIP/PKUNZIP 2.50 instead of 2.04), it is recommended to use the newer version instead in order to support both Windows-style long filenames and DOS 8.3 names. DJGPP programs generally support long file names under DOS.

3. Switching the command shells in vDosPlus

In vDosPlus 2017.08.01 there are two built-in command shells, namely the built-in 4DOS 8.00 command shell and the internal non-4DOS command shell. 4DOS 8.00 is a famous command interpreter for DOS by JP Software (later enhanced by Luchezar Georgiev) which provides powerful command-line and other functionalities, so it is the default command shell in vDosPlus. It includes features like customizable settings and long filename (LFN) support, and an interactive help system is provided so that users can get detailed help information from it. However, besides the 4DOS 8.00 shell you can also use the internal non-4DOS command shell in vDosPlus, which is the improved version of the command shell used in original vDos 2017.08.01. There are both common features and differences between the two shells. For example, vDosPlus-specific commands such as USE, UNUSE and SETCFG can be used in both shells, but some commands like BREAK only exist in the 4DOS shell. In general, the internal non-4DOS shell is considered to be less full-featured than the 4DOS 8.00 counterpart partly because 4DOS has many extended commands, functions and options, but the former shell also saw significant improvements since its initial release. The improvements of the internal non-4DOS shell in vDosPlus 2017.08.01 over the original command shell in vDos 2017.08.01 include (among others) Tab or file name completion, long filename support, better command-line history, editing and redirections, and several additional or improved commands. A HELP command is also added to provide a help system for this shell in vDosPlus. If a specific command (e.g. TREE) is only available in the 4DOS shell, you can still execute it in the internal non-4DOS shell using a syntax like "4DOS /C TREE". Generally you may want to specify the shell to use when vDosPlus starts by setting the SHEL4DOS directive in the config file (or just leave it empty if you simply want to use the default one, which is the 4DOS 8.00 shell), but you can also switch the command shell to use inside vDosPlus with the SETCFG command, i.e. "SETCFG SHEL4DOS=ON" specifies the built-in 4DOS 8.00 shell whereas "SETCFG SHEL4DOS=OFF" specifies the internal non-4DOS shell. If the specified command shell is different from the current command shell then it will become the active shell when you either run the COMMAND command or shelling from some program after the SETCFG command. With this you are able to select the command interpreter to be shelled to when the "shelling to DOS" function is called from some DOS program according to your needs.

In addition, you can also use another (external) command shell such as the MS-DOS 7.10 COMMAND.COM shell inside vDosPlus, although these shells are not included with the vDosPlus package, and you need to rename them (e.g. to MSCMD.COM) in order to be used in vDosPlus. External shells like the MS-DOS 7.10 command shell support the long filename feature provided by vDosPlus, whereas command shells from earlier DOS versions (e.g. MS-DOS 5.xx/6.xx) generally do not support it. Also, external commands from MS-DOS (or another DOS like FreeDOS) such as CHOICE, FC, FIND, MORE and SORT can be used directly in vDosPlus as well (no matter which shell is currently active) as long as you have the executable(s) and the DOS version number matches (use the DOSVER config option to change the reported DOS version in vDosPlus if needed). Nevertheless, external command shells are usually not fully tested for use with vDosPlus, and while they may work in many cases there can be chances that they may not work properly in other cases, so please use them at your own risk in case you do want to use them with vDosPlus.

4. Blinking text and cursor in vDosPlus

Like in a real DOS, vDosPlus can either display blinking foreground characters or display characters in bright background. Only one of them can be shown in DOS or vDosPlus at a time, but not both at the same time. You can specify the setting (blinking foreground characters or characters in bright background) you want to use with the BrightBG option in 4DOS.INI located in the vDosPlus directory if you are using the 4DOS 8.00 shell, which is the default shell of vDosPlus. Bright background will be enabled if "BrightBG=Yes" is set, and blinking foreground characters will be enabled if "BrightBG=No" is set. When bright background is enabled with "BrightBG=Yes" then the blinking foreground characters will be automatically disabled, and the reverse is also true. This setting can be changed dynamatically with the SETDOS command in the 4DOS shell as well. For example:


Will enable the bright background; and to enable blinking foreground characters, just enter the following command:


If you are using the internal non-4DOS shell instead of the 4DOS 8.00 shell, then you can execute the above commands with the "4DOS /C " prefix, i.e. "4DOS /C SETDOS /B1" and "4DOS /C SETDOS /B0" will enable the bright background and blinking foreground characters respectively.

To verify that blinking text is currently active in vDosPlus, you can command for example "COLOR 0 15" in the default 4DOS shell (or "4DOS /C COLOR 0 15" in the internal non-4DOS shell). If blinking foreground characters are currently enabled you will be able to see it with this command, otherwise you will see characters in bright background.

Furthermore, unlike original vDos, vDosPlus supports a blinking cursor. It is enabled in vDosPlus by default as in a real DOS or Windows Command Prompt, but you can disable it with the BLINKC=OFF config option. Setting the blinking rate is also supported in vDosPlus with the BLRATE config option. It supports the values from 0 to 5, with 0 being the fastest and 5 being the slowest, and the default value is 2. The settings of both config options can be changed dynamically with the SETCFG command in the vDosPlus command line, e.g. "SETCFG BLRATE=3" will set the value of the BLRATE config option to 3. With these config options you will be able to set the cursor inside vDosPlus to your prefered blinking rate.

5. Non-USA keyboard support and date formats

For DOS applications like DOS EDIT and XyWrite that "hook" into the keyboard INT9/IRQ1 interrupt, vDosPlus requires extra steps to support non-US keyboards. If your DOS application does not use keyboard INT9/IRQ1 handling, then vDosPlus uses the same keyboard layout as the host Windows system like in original vDos. If you wish to use a non-US keyboard with vDosPlus when the keyboard INT9/IRQ1 handling is involved, please download the FreeDOS keyb.exe and keyboard.sys from this link and copy them into your vDosPlus folder. Then add two lines to autoexec.txt (or another batch file) that will switch to the needed codepage and load the correct keyboard layout. For example, to use a Spanish keyboard layout, add these two lines:

CHCP 850
KEYB SP,850 /9

Note that the "/9" switch is required. To use (for example) a French keyboard layout instead, simply change "SP,850" in the second line to "FR,850". To use a Czech keyboard, you need to use "852" instead of "850" and "CZ,852" instead of "SP,850".

Alternatively, you can download the more powerful FreeDOS xkeyb from this link and extract the files into some folder accessible from vDosPlus. It is preferred over the standard keyb in many occasions. For example, "XKEYB FR" will use the French keyboard layout. No other switches will be required for this command.

Furthermore, DIR and other commands display dates in the U.S. mm-dd-yyyy format by default. You can change the date format in vDosPlus by changing the country code using the COUNTRY command. For example, to use the International English dd-mm-yyyy date format you may want to set "COUNTRY 61" which changes the country code to 61 (International English). Also, to use the Japanese yyyy-mm-dd date format you can set "COUNTRY 81" which changes the country code to 81 (Japan).

6. Start a Windows program or command processor

Suppose that a Windows program is located in the current directory, the simplest way to start a Windows program is to run it directly from the vDosPlus command line:

program [WAIT][HIDE] command line

program: The Windows program to run.
WAIT: Wait for the program to exit.
HIDE: Start the program or minimized.
command line: Arguments passed on to the program.

Eventual paths in command line (as in program) are those of Windows. The optional WAIT and HIDE need to be in capital letters, and there is no space between them if both are used.

An example that makes use of the start.exe program included in the vDosPlus package:
start /max notepad test.txt

You can also launch a Windows program in the Windows search paths with the use of the Windows command processor (CMD). The vDosPlus CMD command is linked to Windows CMD command. It can be used at the vDosPlus command line, or from within a program by (note that if "program" is supplied, the quotes are mandatory):
CMD ["program"] [WAIT][HIDE] command line

Some examples:
CMD "notepad" mydoc.txt
CMD HIDE /c mytest.bat
CMD /c start /max notepad

Essentially vDosPlus will determine if the specified program is a DOS or Windows program and will start that inside the vDosPlus virtual DOS machine (DOS program) or in a new window (Windows program). Program can for instance even be a document, to be opened by the associated Windows program.

Note: Some DOS programs do not execute external programs directly, but call the DOS command processor (command.com) to achieve this result.

7. vDosPlus command-line syntax

Using vDosPlus' command-line options you can enable logging debugging information to a file and/or specify config file name and settings directly.

General syntax for vDosPlus: vDosPlus.exe [/log] [/cfg configfile] [/set config options]
[/log]: Logs debugging information to the file named vDosPlus.log
[/cfg configfile]: Specifies the name of the config file to use instead of config.txt
[/set config options]: Overrides the specified setting(s) in the config file

Example 1. To start a vDosPlus session using your current config.txt and autoexec.txt files:

Example 2. To start a vDosPlus session using your current config.txt and autoexec.txt files, and also logs debugging information to the file vDosPlus.log:
vDosPlus.exe /log

Example 3. To start a vDosPlus session taking config settings from config.new (not config.txt) and using your usual autoexec.txt file:
vDosPlus.exe /cfg config.new

Example 4. To start a vDosPlus session using your current config.txt and autoexec.txt files, but overriding the frame= and showital= settings in config.txt:
vDosPlus.exe /set frame=on; showital=off

Example 5. To start a vDosPlus session taking config settings from config.new (not config.txt) and using your usual autoexec.txt file, but overriding the frame= and showital= settings in **config.new**:
vDosPlus.exe /cfg config.new /set frame=on; showital=off

Example 6. To start a vDosPlus session using your current config.txt file but autoexec.new instead of autoexec.txt:
vDosPlus.exe /set autoexec=autoexec.new

Example 7. To start a vDosPlus session using config.new and autoexec.new:
vDosPlus.exe /cfg config.new /set autoexec=autoexec.new

Example 8. To start a vDosPlus sessions using config.new and autoexec.new, overriding the frame= and showital= settings in config.new, and also logs debugging information to the file vDosPlus.log:
vDosPlus.exe /log /cfg config.new /set autoexec=autoexec.new; frame=on; showital=off

Note: The DOS environment variable %VDOSP_ARGS% (or %WIN_VDOSPLUS% in earlier vDosPlus versions) is set when vDosPlus starts, which contains the content of the Windows %VDOSPLUS% environment variable, or the command line of vDosPlus if the above options are not used. Moreover, you can also change most config settings in the DOS command line on the fly using vDosPlus' internal SETCFG/SETPORT/SETCOLOR commands. Type "HELP SETCFG"/"HELP SETPORT"/"HELP SETCOLOR" in the DOS command line for more information about these commands.

Return to vDosPlus main page

Wengier, November 2017
Email: wengierwu@yahoo.com