Link to home
Start Free TrialLog in
Avatar of Inuyashapl
Inuyashapl

asked on

vbscript Creating pdf printer port

Need vbscript  for Creating pdf printer port. This is what I have so far. Assistance or different script is much appreciated.


WshShell.Run "regsvr32 /s \\ServerName\FolderName\Prnadmin.dll",1,TRUE
 
'************** Create the port first *******************************
 
dim oPort,objShell,oMaster,oPrinter,uProfile
 
 
set oPort = CreateObject("Port.Port.1")
Set objShell=CreateObject("WScript.Shell")
uProfile=objShell.ExpandEnvironmentStrings("%USERPROFILE%")
 
set oMaster = CreateObject("PrintMaster.PrintMaster.1")
 
oPort.PortName = uProfile
 
oPort.PortType = 4
 
oMaster.PortAdd oPort
 
if Err <> 0 Then
 
msgbox "There was an error creating the port."
 
end If
 
'********************************************************************
 
'************** Create the printer second ***************************
'Change MyPrinter to the name of the printer that you are adding.
'Change PrinterDriver to the name of the printer driver that you are adding.
 
 
set oPrinter = CreateObject("Printer.Printer.1")
 
oPrinter.PrinterName = "USPTO PDF Publisher"		' name of the printer as it appears in the Printers folder
 
oPrinter.DriverName = "Adobe PDF Converter"		' name that is referenced in ntprint.inf
 
oPrinter.PortName = "uProfile"		' Specify a port name. Can also point to LPT or COM port.
 
oMaster.PrinterAdd oPrinter
If Err <> 0 Then
 
msgbox "There was an error creating the printer."
 
end If
 
 
msgbox "The script is finished."

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Karl Heinz Kremer
Karl Heinz Kremer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Inuyashapl
Inuyashapl

ASKER

I need to create a seperate pdf printer object on pc's that already have adobe acrobat. My need for this is to setup a joboptions template different from adobe's standard for another type of pdf document creation.