PC Review


Reply
Thread Tools Rate Thread

.bat file in statup folder - keep window open?

 
 
Paul Kraemer
Guest
Posts: n/a
 
      23rd Sep 2004
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
 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      23rd Sep 2004
"Paul Kraemer" wrote:
>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
--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
Reply With Quote
 
David Wang [Msft]
Guest
Posts: n/a
 
      25th Sep 2004
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.
//
"Paul Kraemer" <(E-Mail Removed)> wrote in message
news:23ac01c4a16f$69128640$(E-Mail Removed)...
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WIN XP Statup failed for missing file. =?Utf-8?B?Um9nZXJQ?= Windows XP General 3 2nd Nov 2005 11:59 PM
[Q] Folder OPEN always opens in a new window even though I have it set as open in same window.... Donovan J. Edye Windows XP General 5 14th Oct 2005 08:17 PM
Folder's & Control not Open after window's update, WIndow XP Home =?Utf-8?B?SmFjaw==?= Windows XP Accessibility 1 9th Mar 2005 10:20 PM
explore window close when open certain file or folder. Suddacha Windows XP General 1 11th Aug 2004 11:43 PM
Double-clicking File Folder no longers open folder, instead cmd window there nomp Windows XP Accessibility 2 10th Jan 2004 03:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:27 AM.