View Full Version : disable close on exit in command prompt


rchappelear
03-20-2004, 05:29 PM
Is there any way to disable close on exit in a command
prompt window. I have a dos program thats called when
another program opens, but the dos program closes with
information on what happened before I can read what it
says. If I could disable close on exit, or create a log
file of what shows in the window, I could resolve my
problem. Any help would be greatly appreciated

Torgeir Bakken \(MVP\)
03-20-2004, 05:36 PM
rchappelear wrote:

> Is there any way to disable close on exit in a command
> prompt window. I have a dos program thats called when
> another program opens, but the dos program closes with
> information on what happened before I can read what it
> says. If I could disable close on exit, or create a log
> file of what shows in the window, I could resolve my
> problem. Any help would be greatly appreciated
Hi

Try this if you have control over the launch parameters:


%comspec% /k "my other program here"



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Torgeir Bakken \(MVP\)
03-20-2004, 05:36 PM
rchappelear wrote:

> Is there any way to disable close on exit in a command
> prompt window. I have a dos program thats called when
> another program opens, but the dos program closes with
> information on what happened before I can read what it
> says. If I could disable close on exit, or create a log
> file of what shows in the window, I could resolve my
> problem. Any help would be greatly appreciated
Hi

Try this if you have control over the launch parameters:


%comspec% /k "my other program here"



--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx

Al Dunbar [MS-MVP]
03-20-2004, 05:39 PM
"rchappelear" <anonymous@discussions.microsoft.com> wrote in message
news:10dd801c40ea0$de7f56e0$a101280a@phx.gbl...
> Is there any way to disable close on exit in a command
> prompt window. I have a dos program thats called when
> another program opens, but the dos program closes with
> information on what happened before I can read what it
> says. If I could disable close on exit, or create a log
> file of what shows in the window, I could resolve my
> problem. Any help would be greatly appreciated

If you can set it up so that a batch file is called instead of the
executable, then you could just create a batch file to run the executable
and then pause, i.e.:

@echo off
"C:\program files\acme\coyote_anvil.exe"
pause

The program that causes the dos program to be called - is it a dos program
too, or what?

/Al

Al Dunbar [MS-MVP]
03-20-2004, 05:39 PM
"rchappelear" <anonymous@discussions.microsoft.com> wrote in message
news:10dd801c40ea0$de7f56e0$a101280a@phx.gbl...
> Is there any way to disable close on exit in a command
> prompt window. I have a dos program thats called when
> another program opens, but the dos program closes with
> information on what happened before I can read what it
> says. If I could disable close on exit, or create a log
> file of what shows in the window, I could resolve my
> problem. Any help would be greatly appreciated

If you can set it up so that a batch file is called instead of the
executable, then you could just create a batch file to run the executable
and then pause, i.e.:

@echo off
"C:\program files\acme\coyote_anvil.exe"
pause

The program that causes the dos program to be called - is it a dos program
too, or what?

/Al