hesautoit Posted January 21, 2008 Share Posted January 21, 2008 hi, im new to autoit. pls kindly help me. i cant add printers using runasset Error message as below Error: Line -1 Error : Unable to execute the external program. The directory name is invalid. CODEDriveMapAdd("R:", "\\server\folder", 8) RunAsSet("administrator", @ComputerName, "password") Runwait("rundll32 shell32.dll,SHHelpShortcuts_RunDLL AddPrinter") ;Run("rundll32.exe printui.dll,PrintUIEntry /il", @SystemDir) RunAsSet() WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!l") Send("!n") WinWaitActive("Add Printer Wizard") Send("!c") Send("l") Send("!n") WinWaitActive("Port Name") Send("\\printserver\HR 3005pcl") Send("{TAB}") Send("{ENTER}") WinWaitActive("Add Printer Wizard") Send("!h") WinWaitActive("Install From Disk") Send("\\server\folder\Printer_Driver\HP3005\Win32_2000_XP_S2003\PCL6") Send("{ENTER}") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("HR 3005PCL") Send("!n") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!o") Send("!n") WinWaitActive("Add Printer Wizard") Send("{ENTER}") if i try this code, when asking for port name, there is an error. using systemDir cannot add network ports? CODEDriveMapAdd("R:", "\\server\folder", 8) RunAsSet("administrator", @ComputerName, "password") ;Runwait("rundll32 shell32.dll,SHHelpShortcuts_RunDLL AddPrinter") Run("rundll32.exe printui.dll,PrintUIEntry /il", @SystemDir) RunAsSet() WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!l") Send("!n") WinWaitActive("Add Printer Wizard") Send("!c") Send("l") Send("!n") WinWaitActive("Port Name") Send("\\printserver\HR 3005pcl") Send("{TAB}") Send("{ENTER}") WinWaitActive("Add Printer Wizard") Send("!h") WinWaitActive("Install From Disk") Send("\\server\folder\Printer_Driver\HP3005\Win32_2000_XP_S2003\PCL6") Send("{ENTER}") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("HR 3005PCL") Send("!n") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!n") WinWaitActive("Add Printer Wizard") Send("!o") Send("!n") WinWaitActive("Add Printer Wizard") Send("{ENTER}") Link to comment Share on other sites More sharing options...
hesautoit Posted January 22, 2008 Author Share Posted January 22, 2008 upz Link to comment Share on other sites More sharing options...
JerryD Posted January 22, 2008 Share Posted January 22, 2008 In the first case, I suspect the local Administrator account doesn't have access to the share. Not sure what's happening in the second case. Link to comment Share on other sites More sharing options...
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