dcjohnston Posted June 21, 2007 Share Posted June 21, 2007 The script starts and takes input from the user, but instead of installing the printer, the script ends. If I run the script seperatly it runs fine. Is there any reason for the script ending before completion?ThanksDim $MynameDim $DomainDim $myPassword$Myname="a9dj5"$Domain="Corp"$myPassword="mypass"If FileInstall("c:\Ipprint.vbs", @ScriptDir & '\', 1) Then RunAsSet($Myname, $Domain, $myPassword) Run(@ComSpec & ' /c cscript "' & @ScriptDir & '\ipprint.vbs"')Else MsgBox(16, "Error", "Failed to extract required VBScript file.")EndIf Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 21, 2007 Share Posted June 21, 2007 The script starts and takes input from the user, but instead of installing the printer, the script ends. If I run the script seperatly it runs fine. Is there any reason for the script ending before completion?That code looks familiar! Use RunWait() instead of Run(), if you want the script to wait for the command to complete. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
dcjohnston Posted June 21, 2007 Author Share Posted June 21, 2007 (edited) Yup, its yours my friend, however the code executes and the vbscript input boxes come up to accept information. When the part of the vbscript starts that installs the printer and iP port, the cscript window dissappears and no printer gets installed. The script runs fine outside the Autoit code. Could this be an issue with rights? I am using the correct credentials. It seems when the part of the vbscript that requires admin rights starts, the process ends. That code looks familiar! Use RunWait() instead of Run(), if you want the script to wait for the command to complete. Edited June 21, 2007 by dcjohnston Link to comment Share on other sites More sharing options...
dcjohnston Posted June 21, 2007 Author Share Posted June 21, 2007 Solved.. I think...Here is the code. I had to use the 2 RunAsSet($Myname, $Domain, $myPassword,2)Stay tuned.... Yup that did it... Its all in the options...Thanks again...Yup, its yours my friend, however the code executes and the vbscript input boxes come up to accept information. When the part of the vbscript starts that installs the printer and iP port, the cscript window dissappears and no printer gets installed. The script runs fine outside the Autoit code. Could this be an issue with rights? I am using the correct credentials. It seems when the part of the vbscript that requires admin rights starts, the process ends. Link to comment Share on other sites More sharing options...
PsaltyDS Posted June 22, 2007 Share Posted June 22, 2007 Here is the code. I had to use the 2 RunAsSet($Myname, $Domain, $myPassword,2)Stay tuned.... Yup that did it... Its all in the options...Thanks for posting your results. I hadn't thought of that option, so I learned something from it too. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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