Jump to content

Having A problem trying to run a .vbs script from an autoit .exe


Recommended Posts

I am trying to run a vbscript from inside one of my AutoIt .exe's but it wont seem to actually run the .vbs file. Need some help.

here is the line i am tyring to use.

RunWait(@SystemDir & "\wscript.exe " & "c:\tstools\PIHKR1.vbs")

What am i doing wrong?

Thanks

The vbscript isn't executed? AutoIt display a msgbox error? AutoIt script stay in the background?
Link to comment
Share on other sites

Should the command line not be

RunWait(@SystemDir & "\wscript.exe c:\tstools\PIHKR1.vbs")

I could be very wrong.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Developers

Try:

RunWait(@Comspec & " /c cscript.exe c:\tstools\PIHKR1.vbs")

or to keep the command prompt open:

RunWait(@Comspec & " /k cscript.exe c:\tstools\PIHKR1.vbs")

Edited by JdeB

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

Try:

RunWait(@Comspec & " /c cscript.exe c:\tstools\PIHKR1.vbs")

or to keep the command prompt open:

RunWait(@Comspec & " /k cscript.exe c:\tstools\PIHKR1.vbs")

Well it opens up dos and changes to the tstools dir but it still doesnt try and run the script? I verified that the script is there.

THanks

Link to comment
Share on other sites

You could try

Send("#r")
Send(@SystemDir & "\wscript.exe c:\tstools\PIHKR1.vbs")
Send("{ENTER}")


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Mmmh ...

... I don't understand where the problem is.

If you want to use CMD you have to use for windows programms the "start" option, like:

RunWait(@Comspec & " /c start wscript.exe c:\Test.vbs")

If you simple want ot run it, use

RunWait("WScript.exe C:\OrRepOp.vbs")

That should do it.

HTH, Reinhard

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...