Solved

show batch file as it runs

Posted on 2003-11-07
15
377 Views
Last Modified: 2010-04-14
I have a batch file that changes to a directory.

Problem is the "command window" does not stay open when I double-click on the batch file in Windows 2000.  It closes as soon a the directory change is made.

If I were already in a DOS window, this wouldn't be a problem, but I want to run the the batch file from the Windows Desktop without having to open a command window and navigate to the desktop folder in DOS.

Please advise.
0
Comment
Question by:knowlton
  • 7
  • 7
15 Comments
 
LVL 17

Expert Comment

by:RDAdams
ID: 9703661
Does your batch file have the word exit as the last statement?  If yes then remove it.
0
 
LVL 5

Author Comment

by:knowlton
ID: 9703677
It does not have exit as the last statement.
0
 
LVL 17

Expert Comment

by:RDAdams
ID: 9704013
Are you running this as an Icon on the desktop if yes then right click and choose properties.  Make sure run in normal window is checked.
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 5

Author Comment

by:knowlton
ID: 9704023
I know what you are talking about, but no such option is available.
0
 
LVL 17

Expert Comment

by:RDAdams
ID: 9704040
Can you post the text of your batch file?
0
 
LVL 5

Author Comment

by:knowlton
ID: 9704070
Sure.

Here it is:


cd\
cd WINNT
cd MICROS~1.NET
cd FRAMEW~1
cd V10~1.370
gacutil -i c:\tomcsharpcom\tomcsharpcomtest.dll
regasm c:\tomcsharpcom\tomcsharpcomtest.dll


When the last line runs I want the command window to stay open.
0
 
LVL 17

Accepted Solution

by:
RDAdams earned 250 total points
ID: 9704120
Add pause

cd\
cd WINNT
cd MICROS~1.NET
cd FRAMEW~1
cd V10~1.370
gacutil -i c:\tomcsharpcom\tomcsharpcomtest.dll
regasm c:\tomcsharpcom\tomcsharpcomtest.dll
pause
0
 
LVL 5

Author Comment

by:knowlton
ID: 9704159
Adding pause works, but isn't there a way to just keep the window open with a blinking cursor?

When I press <ENTER> after the pause message, the window still closes.
0
 
LVL 17

Expert Comment

by:RDAdams
ID: 9704176
What directory do you want to be in when it stops

cd c:\tomcsharpcom

Might work.  not 100% sure but give it a go.
0
 
LVL 17

Expert Comment

by:RDAdams
ID: 9704179
cd\
cd WINNT
cd MICROS~1.NET
cd FRAMEW~1
cd V10~1.370
gacutil -i c:\tomcsharpcom\tomcsharpcomtest.dll
regasm c:\tomcsharpcom\tomcsharpcomtest.dll
cd c:\tomcsharpcom

taking out the pause?

0
 
LVL 5

Author Comment

by:knowlton
ID: 9704211
Does not work, sorry.  :)
0
 
LVL 17

Expert Comment

by:RDAdams
ID: 9704334
I will think about this a little more and see if I can find a workable solution.
0
 
LVL 5

Author Comment

by:knowlton
ID: 9704345
Okay.

Don't spend too much time :) this is not a big deal.

Thanks again,

Tom
0
 

Expert Comment

by:zafaric
ID: 10327260

Put CMD as the last command (instead of PAUSE) and the windows should saty open with blinking cursor.
0
 
LVL 5

Author Comment

by:knowlton
ID: 10327392
zafaric:

Yiou are correct.  Please pick up some points here:

http://www.experts-exchange.com/Operating_Systems/Win2000/Q_20880347.html
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question