Skip navigation

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

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_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device

This type REG_SZ value has a default string value of PrinterName,winspool,LPT1:. When set for a network printer, the string value is \\ServerName\PrinterShare,Description,LPTn:. The description is not important so the string value can be expressed as \\ServerName\PrinterShare,,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:


     \[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows\]

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 ).

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.