Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
June 20, 1999
To use a network printer in a DOS program, you must issue a:
NET USE LPTx: \ComputerNamePrinterShare.
In tip 0672, we learned that the default printer information is located at:
HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindowsDevice
Using REGFree, we can add either of the following to a logon script:
for /f "Tokens=1-5 Delims=,: " %%i in ('reg -listvalue "HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsDevice"') do set prt=%%j&set port=%%lnet use %port%: %prt%
OR
for /f "Tokens=2 Delims=, " %%i in ('reg -listvalue "HKCUSoftwareMicrosoftWindows NTCurrentVersionWindowsDevice"') do set prt=%%inet use LPT1: %prt%
You May Also Like