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."
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER