JSI Tip 0672 - How do I set a roaming users default printer based upon the PC they logon at?

Jerold Schulman

August 23, 1998

1 Min Read
ITPro Today logo in a gray background | ITPro Today

If a roaming user normally logs on in building 1, you may not want them to print to the same printer (by default) if they logon in building 2. You can alter this behavior in a login script.

A users' default printer is defined at:

HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindowsDevice

This type REG_SZ value has a default string value of PrinterName,winspool,LPT1:. When set for a network printer, the string value is \ServerNamePrinterShare,Description,LPTn:. The description is not important so the string value can be expressed as \ServerNamePrinterShare,,LPTn:.

There are many possible ways to effect this in a login script. Here is any easy one to understand and administer:

1. For each ComputerName in your organization, create a ComputerName.REG file that contains the appropriate setting for the default printer used by that PC and store it in the NetLogon share on your server(s). For example, computer JSI5 should use the HP1600C share name served by JSI2. Therefore, JSI5.REG should contain:

     REGEDIT4

     [HKEY_CURRENT_USERSoftwareMicrosoftWindows NTCurrentVersionWindows]
     "Device"="\\JSI2\HP1600C,,LPT1:"

2. Issue the following command in your script:

     If exist "%LogonServer%Netlogon%ComputerName%.REG" regedit /S "%LogonServer%Netlogon%ComputerName%.REG"

NOTE: the /S switch of regedit.exe causes it to be Silent.

Of course, it you use W9x clients, you will have to set the missing environment variables ( see tip 120 ).

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.

You May Also Like