Hmm... that's wierd. It's not letting me either.
Copy and paste this script into Notepad and save it as defaultprinter.vbs
Code:
Dim WShell, PrinterPol
Set objShell = WScript.CreateObject("WScript.Shell")
'****Read the value for the default printer set by group policy
'Switch Error Reporting Off
On Error Resume Next
'Attempt to read key
strPrinterPol = objShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\DefaultPrinter\DefaultPrinter")
'Turn error reporting back on
On Error Goto 0
'Check the length of the key to see if the registry has retrieved anything.
If Len(strPrinterPol) > 0 Then
Call funSetDefaultPrinter(strPrinterPol)
Else
' Wscript.echo "policy doesn't exist"
End If
Wscript.Quit
'########## Functions ############
Function funSetDefaultPrinter(strPrinterName)
'Get details about the printer, e.g. what it uses to spool (e.g. winspool) and port name (e.g NE01:)
'These commands just read from the registry but because the path to the key may contain back slashes the normal regread function won't work
'strPrinterPort is what is returned (it will be like "winspool, NE01:")
Const HKEY_USERS = &H80000003
strComputer = "."
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = ".DEFAULT\Software\Microsoft\Windows NT\CurrentVersion\Devices"
objReg.GetStringValue HKEY_USERS, strKeyPath, strPrinterName, strPrinterPort
'wscript.echo StrPrinterPort
'Put the printer name and port name together
strDefPrintKey = StrPrinterName & "," & strPrinterPort
'Now Write the values to the registry to set the default printer
objShell.RegWrite "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device", strDefPrintKey, "REG_SZ"
End Function Copy and paste this script and save it as defaultprinter.adm
Code:
CLASS MACHINE
CATEGORY "Printers"
POLICY "Set Default Printer"
KEYNAME "Software\Microsoft\Windows\CurrentVersion\Policies\DefaultPrinter"
PART "DefaultPrinter"
EDITTEXT
VALUENAME "DefaultPrinter"
END PART
END POLICY
END CATEGORY
I'm assuming that you've already got printers installing themselves via group policy and pushprinterconnections.exe utility. And also that you know how to add custom adm files to group policy and add vbs files to your logon batch file (you could probably also initate this script using the logon scripts part of group policy though I haven't tested that). If you need help with these, let me know. It's only been tested with Server 2003 and Windows XP. Good luck!