Jump to content

Run batch file


Recommended Posts

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.")
Link to comment
Share on other sites

  • Moderators

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

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Developers

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

Likely the workdir is different when ran manually?

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

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

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