Jump to content
Sign in to follow this  
loudguitar76

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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

The vbscript isn't executed? AutoIt display a msgbox error? AutoIt script stay in the background?

No thats the thing it doesnt pass any error messages, it does everything else it is supposed to do except run the script.

Share this post


Link to post
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")

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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Ok, another more creative option:

$oWSH = ObjCreate("Wscript.Shell")

$oWSH.run("C:\Test.vbs",1,TRUE)

Best regards, Reinhard

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...