I had to call an exe with some options. So I wrote a bat for it. But after executing the bat file, it always kept a command window open until I explicitly close it or the executed program finishes. Actually the command window remains open till the control is returned from the exe to bat again. Point to be noted is EXIT doesn't help in this case as it's call is also deferred until control is returned back.
eg.
start-netbeans.bat
netbeans --jdkhome d:\dev\jdk
putty-to-server.bat
d:\programs\putty -pw password username@ip-addrs
Use start before the command so your bat calls the exe and continues its execution i.e. doesn't wait for the exe to complete the execution
start netbeans --jdkhome d:\dev\jdk
start d:\programs\putty -pw password username@ip-addrs
You can use pause command for "Press any key to continue . . ."
8 comments:
You do this without using a batch file. You can create a shortcut and put your command line options into it.
@ryan nice suggestion. I really never thought about this. Although i may still need a .bat for multi-line scripts but this will solve the problem for the ones and likes that i put in example.
oh, it didn't occured to me, was doing simmilar stuff for shell script @GNU/Linux but seems to be getting to old for batch scripting now. <- nearly 2 yrs since my last batch file.
But now pause and start both in my list.....
It was really helpful for me. i was looking for a solution exactly like this. thanks a lot. :)
It was really helpful for me. i was looking for a solution exactly like this. thanks a lot. :)
Saved my day :) Thanks!!
Thanks for sharing this tip !
Thanks for sharing, saved me a lot of aggravation!
Post a Comment