stev379 Posted February 19, 2005 Share Posted February 19, 2005 Why would this fail with "Unable to execute external program"? It works if I replace the vbs file name with "notepad.exe". The vbs script runs without error when double-clicked, just not when called from this AutoIT script. Run(@SystemDir & "\FILE.vbs") Link to comment Share on other sites More sharing options...
Developers Jos Posted February 19, 2005 Developers Share Posted February 19, 2005 Why would this fail with "Unable to execute external program"?It works if I replace the vbs file name with "notepad.exe".The vbs script runs without error when double-clicked, just not when called from this AutoIT script.Run(@SystemDir & "\FILE.vbs")<{POST_SNAPBACK}>Try:Run(@comspec & " /c cscript.exe " & @SystemDir & "\FILE.vbs") SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
stev379 Posted February 19, 2005 Author Share Posted February 19, 2005 Pefect! Thanks! Link to comment Share on other sites More sharing options...
stev379 Posted February 19, 2005 Author Share Posted February 19, 2005 Related question: The vbs script is very small (sets dns suffix for this connection) and has minor error checking to see if input was entered or not. This works when just the vbs script is double clicked. However, when running the vbs script from the AutoIT script, it completes it's task without error, but fails to return the success message or failure message if I cause it to fail. Just to be clear, the error checking text for this action is within the vbs script. If there is a way to set the DNS suffix with AutoIT, that would work even better. I just haven't found a way to do so. The question: How can the error checking within the vbs script take place when the vbs script is called from an AutoIT script? OR How can a DNS suffix for this connection be set with an AutoIT script? Thanks for any help or suggestions!! Link to comment Share on other sites More sharing options...
FuryCell Posted February 20, 2005 Share Posted February 20, 2005 Try:Run(@comspec & " /c cscript.exe " & @SystemDir & "\FILE.vbs")<{POST_SNAPBACK}>Cscript.exe causes the script to output to the command line instead of a message box. The Command window might be disappearing before you can see its output.try this instead:Run(@comspec & " /c Wscript.exe " & @SystemDir & "\FILE.vbs") HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code. Link to comment Share on other sites More sharing options...
stev379 Posted February 20, 2005 Author Share Posted February 20, 2005 Thanks!! That did the job. 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