# Net Use command and DOS variables



## battisti (May 7, 1999)

Hello all,

I'm working with an application whose print engine is still DOS-based. It really wants to print to LPT1, so we have to trick it into printing to a network printer using the NET USE command. We've figured out we can get this application to print by executing this DOS command:

NET USE LPT1 \\servername\printername

However, what we need now is to figure out if we can add this command to a Win2K logon script, and have \\servername\printername dynamically generated based on what that user's default printer is.

Any ideas you might on where to go would be greatly appreciated.

Steve


----------



## IMM (Feb 1, 2002)

You should be able to put it in the logon script as per:
Q163551 - Troubleshooting Printing Problems in Windows NT 4.0
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q163551& (see the bit about ghosted connections)

Here's another 
Q154498 - How to Print to Network Printer from MS-DOS-Based Programs
http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q154498&


----------



## battisti (May 7, 1999)

Great, thanks!


----------



## mole (Aug 24, 1999)

I do exactly that and it does work. Make sure your users have permissions on the shared printer.

If your users need to install drivers, you can start the install dialog with:

start \\servername\printername


----------

