?
Solved

show batch file as it runs

Posted on 2003-11-07
15
Medium Priority
?
381 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
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
IF you are either unfamiliar with rootkits, or want to know more about them, read on ....
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

764 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