You may find that your older DOS Applications will not work when installed on Windows 7. This can be due to a known problem on 32 bit Windows 7 according to Microsoft article 2408903 or you may be running a 64 bit edition of Windows 7.
2408903 An MS-DOS-based program that uses the MS-DOS protected mode interface crashes on a computer that is running Windows 7
On Windows 7 64 bit edition, the NTVDM is not available. If you have an older DOS application which you still need to use on your Windows 7 client. You can install your DOS application within the Windows XP Mode virtual machine.
We will be focusing specifically on enabling printing from an older DOS application within your Windows XP Mode virtual machine. If you have not already download and installed the Windows XP Mode virtual machine on you Windows 7 client system. Please walk through the steps listed in the below external web page.
Download Windows XP Mode
Before we start on the configuration of the Windows XP Mode virtual machine, we will need to be sure that the Windows 7 client system is configured correctly for the DOS application to print to the local printer.
First we will need to open System from the control panel and then click on “Advanced System Setting” to confirm that the Windows 7 computer name conforms to DOS 8.3 naming convention.
Naming Files, Paths, and Namespaces
Click on the Computer Name tab and verify that the computer name is no more than 8 characters long with no spaces or special characters. If the computer is not within a domain environment make a note of the Workgroup name. In our example we are using WIN7-PC1 as the computer name and using the name WORKGROUP for the workgroup name.
If you made any changes to the System properties you will be required to reboot the computer for the changes to take effect.
With most locally attached printers they are installed automatically via Plug-n-Play, or you may have utilized the installation disk to install your printer. We will need to be sure the printer has been shared out correctly, to do this click on Devices and Printers from the Start Menu.
Once this open you can Add a printer if one has not been installed as of yet or modify the printer which is going to be used for the DOS application. In our example, we have installed the Lexmark E352DN printer. This printer is using the Lexmark’s Universal printer driver.
Open the properties of the printer and then click on the Sharing tab. Place a check in the box next to Share this printer, as well as enter a Share Name for the printer. Be sure to verify that the share name is no more than 8 characters long with no spaces or special characters. In our example we are using LEXE352 as the share name.
Once you have successfully shared out the printer. Open a command prompt from the Start menu by clicking on All Programs > Accessories > Command Prompt.
Within the command prompt type the command NET SHARE, this will display all available shares from this computer. In our example you will see all of the hidden admin shares as well as the Lexmark printer which we have just shared out.
Now at this point the Windows 7 client has been configured correctly and the printer is available for the DOS application to use. Now start the Windows XP Mode virtual machine by clicking Windows XP Mode from Start > All Programs > Windows Virtual PC
Once the XP Mode virtual machine has started and you have logged onto the system. Open System from the control panel and then click on the Computer Name tab and verify that the computer is connected to the same Domain environment or Workgroup.
In our example we are using XPMODE-VM for the computer name and using the name WORKGROUP for the workgroup name.
From the Start menu of the XP Mode virtual machine click Printers and Faxes to display any installed printers. You will notice that in our example we do not have any printers installed.
From the File drop-menu click on Server Properties and then click on the Drivers tab. From here we will need to install the same printer driver as that which we are going to be using for the DOS application to print to which is installed on the Windows 7 client. In our example, we have installed the Lexmark’s (32-bit) Universal Printer driver.
Once this has completed please restart the XP Mode virtual machine then re-open Printers and Faxes from the start menu. You may now notice a printer has been installed. This is the re-directed RDP printer which is created by default if a compatible printer driver is available. We will not be able to use this printer for the DOS application to print to.
We will need to create a re-direction of the local LPTx port to the shared network printer on the Windows 7 client. Open a command prompt from the Start menu by clicking on All Programs > Accessories > Command Prompt.
Within the command prompt type the command NET USE, this will display all available connects used by this computer. In our example you will see three redirected connections to the drives (Floppy A, Local C, and CD ROM D) on the Windows 7 client.
314499 How to print to a network printer from an MS-DOS-based program in Windows XP
We will need to enter a NET USE command which will redirect the shared printer on the Windows 7 client to LPT1. To do this type the following command;
net use lptx \\printserver\sharename /persistent:yes
In our example we had entered the following command which will redirect the Lexmark shared printer to the local printer port LPT1
net use lpt1 \\win7-pc1\lexe352 /persistent:yes
You may be prompted for a valid User Name and Password of a local user account on the Windows 7 client system. Once you have entered the proper credentials you will receive a reply stating the command completed successfully.
At this point everything has been setup correctly and a persistent connection of Lpt1 which will redirect to the network share on the Windows 7 client computer. Please note that when printing from DOS applications, it may take some time for the document to be printed. This is due to the multiple spooler redirections for the document from the Windows XP Mode LPT1 local port to the shared network printer on the Windows 7 client.