![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Microsoft Windows xp error all errors and bugs related to Microsoft winxp error |
![]() |
|
default printer changed after being new user in local computer
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Fixed Error!
Posts: 1,497
Join Date: Mar 2007
Rep Power: 3
IM:
|
It's like this, user1 have set printer1 as default, but when we create another new user (eg: user2), when we login as user2, the user2 environment isn't printer 1 but another printer as default. How to make that every user that we created are having the same default printer. |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Fixed Error!
Posts: 1,497
Join Date: Mar 2007
Rep Power: 3
IM:
|
Save the scripts below to separate .vbs files. Run the first script on the machine and note the printer name you want as default. Assign the name from the first script to the DesiredDefaultPrinter variable in the second script. Place the second script on the computer in question. Open Regedit and highlight the HKEY_USERS key. Select Load Hive from the File menu and navigate to “C:\D & S\Default User” then select NTUser.dat. It will ask for a name to load the hive as. Under the name you choose navigate to Software\Microsoft\Windows\CurrentVersion\RunOnce. If RunOnce does not exist (which it does not by default) add it manually. Then within that key add a REG_SZ value. Modify the value you added and enter the full path to the second script. When a new user logs on for the first time NTUser.dat is copied from the default user profile and saved in the profile of the user logging on. NTUser.dat is then mapped to the HKEY_Current_User key in the registry each time a user logs on. This should get you what you want. Cheers, Krompton '~ Script to see printer names available on machine strComputer = "." ' The . means local machine Set objNetwork = CreateObject("WScript.Network") Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonat e}!\\" & strComputer & "\root\cimv2") Set colPrinters = objWMIService.ExecQuery ("Select * From Win32_Printer") For Each objPrinter in colPrinters WScript.Echo objPrinter.Name Next '~ ************************************************** ***************** '~ Script to set default printer Set objNetwork = CreateObject("WScript.Network") DesiredDefaultPrinter = "Name From Above Script" objNetwork.SetDefaultPrinter DesiredDefaultPrinter WScript.Quit |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|