Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a requirement that through group policy all client computers needs to have a Printer installed called "PostScript Printer", every example I find online is for installing a network printer (which is not what I want).

Any help would be appreciated.


share|improve this question
A bit more info about that this printer is would be really useful – Izzy Jul 16 '09 at 14:18
There is no printer. I'd just like to hijack some default drivers. – Allain Lalonde Jul 16 '09 at 14:29
up vote 1 down vote accepted

Following code did the trick for me. Not perfect, but it works.

Option Explicit

'On Error Resume Next
Dim oWshShell, objWMIService

Set oWshShell = CreateObject("WScript.Shell")
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")  

Function PrinterExists(PrinterName)    
  Dim colPrinters, objPrinter

  Set colPrinters = objWMIService.ExecQuery _
      ("Select * From Win32_Printer Where DeviceID = '" & PrinterName & "'")  

  PrinterExists = False
      For Each objPrinter in colPrinters
      PrinterExists = True
End Function

Sub RenamePrinter(NameBefore, NameAfter)
  Dim colPrinters, objPrinter
  Set colPrinters = objWMIService.ExecQuery _
      ("Select * From Win32_Printer Where DeviceID = '" & NameBefore & "'")  

  For Each objPrinter in colPrinters
End Sub

Function InstallPrinter(PrinterName)
  If Not PrinterExists(PrinterName) Then
    Installing = oWshShell.Run("rundll32 printui.dll PrintUIEntry /if /f         %windir%\inf\ntprint.inf /r ""file:"" /m """ & PrinterName & """")
  End If

  Dim FailCount
  FailCount = 0

  Do While Not PrinterExists(PrinterName) And FailCount < 5
    WScript.Sleep 1000
    FailCount = FailCount + 1

  InstallPrinter = PrinterExists(PrinterName)
End Function

Dim Installing

If Not PrinterExists("PostScript Printer") Then
  'XP makes this apple printer available
  If InstallPrinter("Apple Color LW 12/660 PS") Then
    RenamePrinter "Apple Color LW 12/660 PS", "PostScript Printer"
    'Don't know of a vista one yet
  End If
End If
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.