Solved

show batch file as it runs

Posted on 2003-11-07
15
378 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Tom 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
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
LVL 5

Author Comment

by:Tom 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:Tom 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:Tom 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:Tom 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:Tom 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:Tom 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

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…
While it may be true that the internet is a place of possibilities, it is also a hostile environment lurking with many dangers. By clicking on the wrong link, trusting the wrong person or using a weak password, you are virtually inviting hackers to …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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