Thanks John, I don't think you *fully* understood my original
post and follow-up to a reply I received. You didn't include
them so I had to paste them below, and note the CAPS I changed
for emphasis:
----------------------
Hi all, can anyone please tell me what I need to add or change
to this below for the command prompt window to disappear
*IMMEDIATELY AFTER STARTING* this batch file?
@title HDDTemperature Manager
@echo Running HDDTemperature... Wait until it's done.
net.exe start HDDTService
@"C:\Program Files\PalickSoft\HDD
Temperature\HDDTemperature.exe"
@echo Stopping unnecessary service...
@net stop HDDTService
I tried X'ing out of the cmd prompt window and the service is
not stopped when the program is closed. This works fine, the
service starts and the program starts & runs fine, and the
service stops when closing the program. I just need to find a
way to get rid of that DOS/command window after the batch file
is clicked.
-------This is a reply to a couple of posts-----
Carol and Hugh, thanks. I tried just "exit" at the very end
and that didn't do anything. The cmd window STILL stays open
**DURING THE PROCESS OF THE PROGRAM RUNNING**
and THAT is what I want to close. The cmd window closes fine
when I SHUT DOWN the program. I want to get rid of the cmd
window **right after it opens**, while leaving the program open
as usual and running with no cmd window still open. I tried
"exit"
(no quotes) in several areas which didn't work. (In one area
it never shut down the service when the program was stopped).
----END------
A key phrase you said John is: "...batch file would
automatically close **once the batch file had done its job**".
Since an XP Service is involved, which I assume must be shut
down **BY** the batch file, this is the hanging point which I
can't achieve. I have been able to automatically close the cmd
window after the batch file starts, but when I do that, after I
shut down the program ("HDD temperature" in this case), the
associated "HDDTService" is NOT shut down, it stays on. What
I'm trying to do is find a have the cmd window close WHILE the
program is STILL RUNNING, then have the associated XP Service
automatically shut down AFTER the program is closed. Is this
possible?
Thanks,
-Clint
God Bless
Clint Hamilton, Owner
http://OrpheusComputing.com
=================================
John Selby
Thu, 11 Nov 2004 16:26:24 -0800
Clint asked in this group how to make sure that the window
belonging to a
batch file would automatically close once the batch file had
done its job.
My last post made some suggestions on this, based on what works
with Windows
98 SE.
Since then I've managed to spend a little time with Windows XP
computers
(Win XP home ver SP1) and now recall that the situation is
different.
If you generate a batch file in Windows XP, right click its
icon, select
Properties, there is no "Program" tab and no option to select
"Close on
Exit". The reason for this appears to be that there's no need
for it - such
a file will automatically close on exit as soon as the batch
file has passed
its last command.
At least, this is what I found on experimenting, and remembered
I had been
in this situation before some months ago and found that the
only way to keep
such a window open was by including a Pause command (required a
key press
before continuing).
So, I'm puzzled by Clint's problem. A (Windows XP) batch file
window
apparently closes on its own, without the need for an exit
command in the
script.
On opening the cmd window (Start > Run > cmd) and typing exit
/? one can
gain a bit of information from the system about the exit
command. What may
be of interest is:-
------------------------------------
exit [/B]
Specifies to exit the current batch script instead of cmd.exe
If executed from outside a batch script it will quit cmd.exe
-----------------------------------
So Clint, it looks as though a line in the batch file of
exit /B
should force the batch file window to close with no ambiguity
about what the
exit refers to.
If the application you are invoking from the batch file is an
MS DOS based
program, then I guess you should be able to use the technique
mentioned in
my previous post to ensure that its operating window also
closes
automatically when it is finished.
Hope this is of some help, and my apologies if I haven't
understood
precisely what the problem is.
Cheers,
John Selby.
============= PCWorks Mailing List =================
Don't see your post? Check our posting guidelines &
make sure you've followed proper posting procedures,
http://pcworkers.com/rules.htm
Contact list owner <[EMAIL PROTECTED]>
Unsubscribing and other changes: http://pcworkers.com
=====================================================