Sign in to follow this  
Followers 0
Queener

Run batch file

7 posts in this topic

For some reason I run

ShellExecute("C:\users\aq\desktop\bin\3 - Servertest.bat")

and all it does is open and close. Not suppose to happen.

Inside the batch file:

servertest.exe packt.dat

If I run Servertest.bat without autoit, The batch stays until I close it. Any suggestion?


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites



Why use the batch file at all? Why not simply do something like this?

ShellExecute(<path to servertest.exe>, 'packt.dat')

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

If I run Servertest.bat without autoit, The batch stays until I close it. Any suggestion?

Likely the workdir is different when ran manually?

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

The autoit will be outside of bin for example desktop. I tried

ShellExecute('\bin\servertest.exe', 'packt.dat')

but it doesn't work. "Unable to parse line"

Edited by asianqueen

Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

Share this post


Link to post
Share on other sites

asianqueen,

Try specifying the fully qualified path to the executable.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

If for any reason you still want/need to call that batch file, add a "pause" command at the end of your batch. Then it won't just "open and close", but stay open so you can read any error messages your servertest application writes to the console.

Share this post


Link to post
Share on other sites

that works too, but it closes the batch file after execute. I guess there's no way to keep the batch file open.


Msgbox(0, "Hate", "Just hate it when I post a question and find my own answer after a couple tries. But if I don't post the question, I can't seem to resolve it at all.")

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