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
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
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
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\Co mputerName\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
There are currently 1 users browsing this thread. (0 members and 1 guests)