Dos window automaticlly closes after command??

K

KG

I have noticed when a dos command is run the DOS window closes after the command is run. The
window closes after either a bat file is run or a command is run from the program, run, command
line. Any idea how to keep the window open so I may see the command results?? Thank you in
advance for any assistance.
*****************
Thank You (e-mail address removed)

To reply to this email please remove the AT
after the kGb in the reply to address as shown above.
 
G

Gordon

KG said:
I have noticed when a dos command is run the DOS window closes after
the command is run. The window closes after either a bat file is run
or a command is run from the program, run, command line. Any idea
how to keep the window open so I may see the command results?? Thank
you in advance for any assistance. *****************

Add a "pause" command to the end of the bat file.
 
P

Pegasus \(MVP\)

KG said:
I have noticed when a dos command is run the DOS window closes after the command is run. The
window closes after either a bat file is run or a command is run from the program, run, command
line. Any idea how to keep the window open so I may see the command results?? Thank you in
advance for any assistance.
*****************
Thank You (e-mail address removed)

To reply to this email please remove the AT
after the kGb in the reply to address as shown above.

You can adapt Gordon's suggestion to the "Run" box too.
Instead typing the command directly, such as
ping www.yahoo.com

run it through your own batch file like so:
kg ping www.yahoo.com

kg.bat should reside in the Windows folder and contain
these lines:
@echo off
%1 %2 %3 %4 %5 %6 %7 %8 %9
pause

A better alternative would be to run your commands from
a proper Command Prompt.
 
W

Wesley Vogel

Also cmd /k

/K Carries out the command specified by string but remains

cmd /k whatever_command I.e. cmd /k start iexplore

cmd /k start iexplore in Start | Run will start cmd.exe, start Internet
Explorer (iexplore.exe) and cmd.exe will stay open.

For Pause HELP, paste the following line into Start | Run and click OK...

hh ntcmds.chm::/pause.htm

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top