Sign in to follow this  
Followers 0
loudguitar76

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

11 posts in this topic

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.



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Should the command line not be

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

I could be very wrong.

I will try that and see if that works...Thanks

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          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}")


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

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

Thanks everybody i will try all your suggestions tonight and hopefully poist in the am that it works

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  
Followers 0