itgeek Posted April 30, 2010 Posted April 30, 2010 Hi we have a problem our roaming profile has all the printer that the user has logged onto. How do we get rid of this? Thanks
sted Posted April 30, 2010 Posted April 30, 2010 load regedit go to hkey users file load hive point at your roaming profiles ntuser.dat/man go to printers and delete whaever is there as always before playing round with regedit backup the file or at least export the key you changed
timzim Posted April 30, 2010 Posted April 30, 2010 OR 1. Create/change a user who a. logs on using that profile & b. has write access to the profile folder. 2. rename user.man to user.dat 3. log on as the user in step 1 4. delete the printers from the profile 5. log off again 6. rename user.dat back to user.man
itgeek Posted April 30, 2010 Author Posted April 30, 2010 Ok I now have this working. I am having trouble setting the default printer in the room. I am using the script below but how do I get it to select the deafult printer? Option Explicit DIM RegEntry, ComputerName RegEntry="HKLM\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName" ComputerName = ReadRegValue(RegEntry) if InStr(1,ucase(ComputerName),"LAB1-",vbTextCompare) > 0 then call SetPrinter("\\LAB1\LaserJet") if InStr(1,ucase(ComputerName),"LAB2-",vbTextCompare) > 0 then call SetPrinter("\\LAB2\LaserJet") if InStr(1,ucase(ComputerName),"OFFICE-",vbTextCompare) > 0 then call SetPrinter("\\OFFICE\LaserJet") 'so on and so forth. wscript.quit ' *** This subroutine installs and sets the default printer Sub SetPrinter(ByVal PrinterPath) DIM WshNetwork Set WshNetwork = CreateObject("WScript.Network") WshNetwork.AddWindowsPrinterConnection(PrinterPath) WshNetwork.SetDefaultPrinter Printerpath end sub ' **** This function returns the data in the registry value Function ReadRegValue(ByVal RegValue) DIM WSHShell Set WSHShell = WScript.CreateObject("WScript.Shell") ReadRegValue="" On Error Resume Next ReadRegValue= WSHShell.RegRead(RegValue) End Function
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now