Jump to content

Run fails on vbs


stev379
 Share

Recommended Posts

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

  • Developers

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...