Aqeel Posted February 16, 2007 Posted February 16, 2007 Hi Need help for converting this working VBS script to Autoit VBS SCript to Install Local Printer(lpt1) Set WshShell = Wscript.CreateObject("Wscript.Shell") WshShell.Run "Regsvr32 /s z:\zenapps\printer\Prnadmin.dll",1,TRUE dim oPrinter set oMaster = createObject("PrintMaster.PrintMaster.1") set oPrinter = CreateObject("Printer.Printer.1") oPrinter.PrinterName = "HP LaserJet 5000 Series PCL" ' name of the printer as it appears in the Printers folder oPrinter.DriverName = "HP LaserJet 5000 Series PCL6" ' name that is referenced in ntprint.inf oPrinter.PortName = "lpt1:" ' 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 Thanks ,Aqeel
Aqeel Posted February 16, 2007 Author Posted February 16, 2007 There may be a 1-line run call you can make if you use rundll and printui.dll,PrintUIEntry ... search the web for those terms...Lar.Can u post that line if u have one....
The Kandie Man Posted February 16, 2007 Posted February 16, 2007 This was the first result of a google search for "PrintUIEntry".http://www.robvanderwoude.com/2kprintcontrol.htmlIt is all right there. Look at that, try it in the Run window. If it works, use the Run() function in autoit. If you need help after trying that, let us know. "So man has sown the wind and reaped the world. Perhaps in the next few hours there will no remembrance of the past and no hope for the future that might have been." & _"All the works of man will be consumed in the great fire after which he was created." & _"And if there is a future for man, insensitive as he is, proud and defiant in his pursuit of power, let him resolve to live it lovingly, for he knows well how to do so." & _"Then he may say once more, 'Truly the light is sweet, and what a pleasant thing it is for the eyes to see the sun.'" - The Day the Earth Caught Fire
Aqeel Posted February 16, 2007 Author Posted February 16, 2007 Thanks Lar and Candie for the help. Just for your info i have used the following way to get working RunWait(@SystemDir & "\RUNDLL32 PRINTUI.DLL,PrintUIEntry /if /b " & '"HP LaserJet 5000 Series PCL6"' & " /f " & @WindowsDir & "\inf\ntprint.inf /r " & '"lpt1:"' & " /m " & '"HP LaserJet 5000 Series PCL6"' ) Aqeel
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now