.bat file in statup folder - keep window open?


P

Paul Kraemer

Hi,

I have a .bat file that I have placed in my Windows 2000
startup folder so that it runs when I start my PC.
Sometimes it does what I want it to do, sometimes it
doesn't. Either way, when I start up, I see the command
prompt window come up when my .bat file runs. As soon as
my .bat file is done, it disappears immediately. If one
of the commands in the .bat file returned an error, I
can't see it because the window is gone.

I was just wondering if there is a way that I can make
my .bat file leave the command prompt window open after
it is done.

Thanks,
Paul
 
Ad

Advertisements

M

Matthias Tacke

Paul Kraemer said:
I have a .bat file that I have placed in my Windows 2000
startup folder so that it runs when I start my PC.
Sometimes it does what I want it to do, sometimes it
doesn't. Either way, when I start up, I see the command
prompt window come up when my .bat file runs. As soon as
my .bat file is done, it disappears immediately. If one
of the commands in the .bat file returned an error, I
can't see it because the window is gone.

I was just wondering if there is a way that I can make
my .bat file leave the command prompt window open after
it is done.

Thanks,
Hi Paul,

you could insert commands in your batch to pause if an error occurs.
if errorlevel 1 pause
or
Yourcommand||pause

or change your entry in the startup folder:

%comspec% /K yourbatch.bat

HTH
 
Ad

Advertisements

D

David Wang [Msft]

You may want to consider having your bat file LOG its actions in a log file
so that you can look at it whenever you want (instead of having to EXIT a
cmd window all the time).

You may also want to use Matthias's advice of CMD /K (so that the window
stays around in case of any error) and add the command "EXIT" at the end of
your bat file so that the window automatically disappears on success.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
Hi,

I have a .bat file that I have placed in my Windows 2000
startup folder so that it runs when I start my PC.
Sometimes it does what I want it to do, sometimes it
doesn't. Either way, when I start up, I see the command
prompt window come up when my .bat file runs. As soon as
my .bat file is done, it disappears immediately. If one
of the commands in the .bat file returned an error, I
can't see it because the window is gone.

I was just wondering if there is a way that I can make
my .bat file leave the command prompt window open after
it is done.

Thanks,
Paul
 

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