How to close cmd or command window?

P

Peter Jensen

X-No-Archive: Yes

I use a network computer at work with Windows XP professional. The
signature files for Outlook are unacceptable. I tried changing them, but
no luck - they are changed back each time Outlook is started. I also
tried changing the .ini file, but it too is changed back.

I devised a work around using a .bat file to remove the read only
attribute from the signature files and overwriting them with acceptable
signature files. The only problem now is the cmd or command (tried both)
window won't close itself. I've tried various combinations with start,
cmd and command, but no luck. How can I get the command window to close
automatically?
 
P

Peter Foldes

By default the cmd window will not close automatically by itself. You will need a script to do it. You can try the scripting newsgroup for help on this
 
G

GHalleck

Peter said:
X-No-Archive: Yes

I use a network computer at work with Windows XP professional. The
signature files for Outlook are unacceptable. I tried changing them, but
no luck - they are changed back each time Outlook is started. I also
tried changing the .ini file, but it too is changed back.

I devised a work around using a .bat file to remove the read only
attribute from the signature files and overwriting them with acceptable
signature files. The only problem now is the cmd or command (tried both)
window won't close itself. I've tried various combinations with start,
cmd and command, but no luck. How can I get the command window to close
automatically?

Without looking at the actual *.bat file, it is probably missing the
command "exit" (minus the quotes) as its last line. "Exit" should close
the Command Prompt window.
 
S

Stan Brown

X-No-Archive: Yes
Bwaa-haa-haa.

I devised a work around using a .bat file to remove the read only
attribute from the signature files and overwriting them with
acceptable signature files. The only problem now is the cmd or
command (tried both) window won't close itself. I've tried various
combinations with start, cmd and command, but no luck. How can I
get the command window to close automatically?

The command is EXIT.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
A: Maybe because some people are too annoyed by top posting.
Q: Why do I not get an answer to my question(s)?
A: Because it messes up the order in which people normally read text.
Q: Why is top posting such a bad thing?
 
A

Andy

X-No-Archive: Yes

I use a network computer at work with Windows XP professional. The
signature files for Outlook are unacceptable. I tried changing them, but
no luck - they are changed back each time Outlook is started. I also
tried changing the .ini file, but it too is changed back.

I devised a work around using a .bat file to remove the read only
attribute from the signature files and overwriting them with acceptable
signature files. The only problem now is the cmd or command (tried both)
window won't close itself. I've tried various combinations with start,
cmd and command, but no luck. How can I get the command window to close
automatically?

Try typing exit.
 
P

Peter Jensen

X-No-Archive: Yes

Peter said:
By default the cmd window will not close automatically by itself. You will need a script to do it. You can try the scripting newsgroup for help on this

Thanks to all who responded. Below is an example batch with exit on the
last line. Wordpad starts, but unfortunately, exit does not close the
cmd window.

@echo off
copy /y c:\temp.tmp c:\temp2.tmp
"C:\Programmer\Windows NT\Tilbehør\wordpad.exe"
exit


Which scripting ng would be recommended to ask for help in?
 
U

User

By default the cmd window will not close automatically by itself. You will need a script to do it. You can try the scripting newsgroup for help on this

Exit did not work. I discovered a solution, in case anyone is
interested. Those who responded may want to take note in the event
this question pops up again.

@echo off
rem some batch command
rem some batch command
start "" "Some Windows Application.exe"
exit


The start command above closes the cmd prompt window when run from the
GUI. However, when run from an open cmd window, the exit is required
to close that window.
 
Joined
Sep 21, 2011
Messages
1
Reaction score
0
Thank you, this was a life saver for me. It is a thing of beauty.

>By default the cmd window will not close automatically by itself. You will need a script to do it. You can try the scripting newsgroup for help on this

Exit did not work. I discovered a solution, in case anyone is
interested. Those who responded may want to take note in the event
this question pops up again.

@echo off
rem some batch command
rem some batch command
start "" "Some Windows Application.exe"
exit


The start command above closes the cmd prompt window when run from the
GUI. However, when run from an open cmd window, the exit is required
to close that window.
 

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