Okay, I'm new here. I have play with this script for a couple of days, off and on. I need a new set of eyes on it. There is no problem with adding the printer port but the printer is another thing - it just doesn't work. I had it working and changed some of the variables and now there is somthing wacky with the second RunWait command.
The print drivers are in a folder called Drivers that is in the same folder the script is in.
Here is the code:
Thanks for the help.
GK
The print drivers are in a folder called Drivers that is in the same folder the script is in.
Here is the code:
[ autoit ]
Local $IPAddress = "172.20.20.20" Local $IPName = "012012" Local $octet3 = 20 Local $octet4 = 20 Local $PortName = '"'& "IP_" & $IPAddress & '"' Local $PrinterName = '"'& "HHSPR" &$IPName&'"' ; Check Name "PR" or "RH" Local $PrtDriver = '"HP Color LaserJet CP2020 Series PCL 6"' ;Name of Print Driver goes here Local $PrtComment = '"HP Color LaserJet CP2025"' ; Name of printer goes here for comment field Local $DriveDir = @WorkingDir & "\HP\CP2025\Drivers\autorun.inf" ; Check and change directory and .INF file - Lead with a "\" ;Adding Printing Port Local $InstPrtPort = " /c cscript c:\Windows\System32\prnport.vbs -a -r IP_"&$IPAddress&" -h "&$IPAddress&" -o raw -n 9100 -2e" RunWait(@ComSpec & $InstPrtPort) ;Creatation command for new port ;Installing Print Drivers Local $InstPrtDrv = " /c c:\windows\system32\rundll32 printui.dll,PrintUIEntry /if /b "&$PrinterName&" /f "&$DriveDir&" /r "&$PortName&" /m "&$PrtDriver&"" RunWait(@ComSpec & $InstPrtDrv)
Thanks for the help.
GK