Jump to content
Sign in to follow this  

Running a compiled script from cmd prompt and having it not exit

Recommended Posts



I have a question.

I run compiled scripts from a cmd/dos promt in XP.

Is there any way to have the compiled .exe file not exit until the script has run??

I run these script from a altiris server and as soon as the exe exits it starts another process, i would rather have it to wait until the script has run completely.


Share this post

Link to post
Share on other sites

Can you use the start command? I think if you put:

start /wait scriptname

that will pause the shell until the script exits. Add /min if you don't want to see its output.

Share this post

Link to post
Share on other sites

Another way is to use More to pipe the output to screen so any use of ConsoleWrite is shown within the cmd prompt.

e.g. Test.exe|more

If you enter a series of commands in the prompt and do not want to wait for each one to complete before entering the next, what you can do is this trick.

1. Type an opening brace "(" then press Return. You will then get a more? prompt.

2. Add each command and press Return after each one entered.

3. Then type a closing brace ")" to close the cycle and commence the execution of those commands.


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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.