Microsoft KB Archive/165214

= Troubleshooting MS-DOS-Based Programs in Windows =

Article ID: 165214

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Datacenter Server
 * Microsoft Windows NT Server 4.0 Standard Edition
 * Microsoft Windows NT Workstation 4.0 Developer Edition

-



This article was previously published under Q165214



For a Microsoft Windows XP version of this article, see 314106.



SUMMARY
This article describes how to troubleshoot MS-DOS-based program problems in Windows.



Test the Ntvdm Subsystem
The first thing to test when you are having problems with MS-DOS-based programs is the Windows Virtual Dos Machine (NTVDM) subsystem. You can use Command.com to test whether the NTVDM subsystem is running properly. You can start Command.com by performing the following steps:
 * 1) Click the Start button, and then click Run.
 * 2) In the Open box, type command.com, and then click OK.

This should start a command prompt window. If this does not work properly, there is a problem with the NTVDM subsystem and you should check the following items:   Check the Config.nt and Autoexec.nt files in the %SystemRoot%\System32 folder for non-standard settings.

Using a REM statement, remark out all entries *except* the following default entries:

     Config.nt      - dos=high, umb device=%SystemRoot%\system32\himem.sys files=20

Autoexec.nt     ---

lh %SystemRoot%\system32\mscdexnt.exe lh %SystemRoot%\system32\redir lh %SystemRoot%\system32\dosx lh %SystemRoot%\system32\nw16 (only if CSNW is installed) lh %SystemRoot%\system32\vwipxspx (only if CSNW is installed)

NOTE: Another way to accomplish this is to expand Autoexec.nt_ and Config.nt_ from the Windows CD-ROM disc to the %SystemRoot%\SYSTEM32 folder.  Close all other running programs. This can be accomplished by running Task Manager, closing all running programs, and making sure that there are no other NTVDM processes running. To start Task Manager, press CTRL+SHIFT+ESC. Prevent all programs from running at Startup. Programs can run from three places at startup: the Startup groups, the Run and Runonce lines in the registry, and the "run=" and "load=" lines in the Win.ini file. You can check these places as follows:  The Startup groups are folders on the local hard disk that are in the following locations:  %SystemRoot%\Profiles\ \Start menu\Programs %SystemRoot%\Profiles\Default user\Start menu\Programs</li></ul>

</li> The Run and Runonce lines can be found in the registry under the following registry key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\

</li> You can edit the Win.ini file using Notepad. It is in the %SystemRoot% folder.</li></ul> </li>  Verify the NTVDM system files in the %SystemRoot%\System32 folder. Check the following files and make sure they are the correct version by checking the size and date:

<pre class="fixed_text">     Ntio.sys Ntdos.sys Ntvdm.exe Ntvdm.dll (Windows NT 3.1 only) Redir.exe </li> The registry entries associated with the NTVDM subsystem are: <ul> 

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment

This key stores the environment variables from the Config.sys and Autoexec.bat files for use in Windows.</li> 

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ VirtualDeviceDrivers

This key stores the device drivers to be used in a NTVDM session. These entries are created by Windows Setup when a device driver is installed.</li></ul> </li></ul>

Program-Specific Issues
The following functions do not work in Windows:
 * All MS-DOS functions except task-switching APIs (program programming interface functions) are supported.
 * Block mode device drivers are not supported. (Block devices are not supported, so MS-DOS IOCTL APIs that deal with block devices and SETDPB functions are not supported.)
 * Interrupt 10 function 1A returns 0; all other functions are passed to read-only memory (ROM).
 * Interrupt 13 calls that deal with prohibited disk access are not supported.
 * Interrupt 18 (ROM BASIC) generates a message that says ROM BASIC is not supported.
 * Interrupt 19 will not reboot the computer, but will cleanly terminate the current virtual DOS machine (VDM).
 * Interrupt 2F dealing with the DOSKEY program call outs (AX = 4800) is not supported.
 * Microsoft CD-ROM Extensions (MSCDEX) functions 2, 3, 4, 5, 8, E, and F are not supported.
 * The 16-bit Windows subsystem on an x86 computer supports enhanced mode programs; it does not, however, support 16-bit VxDs (virtual device drivers). The subsystem on a non-x86 computer emulates the Intel 40486 instruction set, which lets the computer run Enhanced-mode programs, such as Microsoft Visual Basic, on RISC computers.

This means that Windows does not support 16-bit programs that require unrestricted access to hardware. If your program requires this, it will not work in Windows NT or Windows 2000.

You should next check to see if the Autoexec.nt and Config.nt file settings are correct. Always try the default settings listed above. Some programs require special settings or drivers to run in the Config.sys or Autoexec.bat file. If this is the case, there are two options for initializing these files when starting your program: <ul> Enter these lines in the Config.nt and Autoexec.nt files in the %SystemRoot%\System32 folder.</li> Create new Config and Autoexec files to be run when starting this program. To do so, follow these steps: <ol> Create the files and save them with the extension .nt in a folder other than %SystemRoot%\System32 (these files are usually saved in the same folder as the program.</li> Right-click the desktop, point to New, and then click Shortcut.</li> In the Command Line box, type the full path to the file you want to run, and then click Next.</li> In the "Select a name for the shortcut" box, type the name for the shortcut, and then click Finish. This creates a new shortcut on the desktop.</li> Right-click the new shortcut, and then click Properties.</li> On the Program tab, click Windows. This opens a dialog box for the path to the Autoexec and Config files.</li> Type the full path to the files you created, and then click OK in both dialog boxes.</li></ol>

Every time this icon is started, it runs the Autoexec and Config files specified for the program. These settings are subject to the same restrictions as listed for MS-DOS-based programs.</li></ul>

There are other settings in a program's properties. If your program is not working properly, you may want to check all the tabs and make sure that the program settings are set to the manufacturer's specification. If the program is still not working, the vendor of the program should be contacted to see if the program is supported under Windows.

For additional information, please see the following articles in the Microsoft Knowledge Base:

ARTICLE-ID: 171940

TITLE : MS-DOS Application I/O Operations Cause Floppy Drive Access

ARTICLE-ID: 102418

TITLE : NTVDM Error: There Is No Disk in the Drive

ARTICLE-ID: 156687

TITLE : Entries in CONFIG.NT or AUTOEXEC.NT May Cause NTVDM Errors

ARTICLE-ID: 142026

TITLE : Err: "Hidden Console of WOW VDM" Running 16-bit or DOS App

For additional information about printing in an MS-DOS-based program, please see the following article in the Microsoft Knowledge Base:

ARTICLE-ID: 163551

TITLE : Troubleshooting Printing Problems in Windows

Additional query words: apps msdos application

Keywords: KB165214

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.