when I run a .bat file it does it's thing
and then sits in the systray...how do I close
down the dos window when the bat file is finised..
id..
do this
do that
DoEvents
....what goes here
unload me
Printable View
when I run a .bat file it does it's thing
and then sits in the systray...how do I close
down the dos window when the bat file is finised..
id..
do this
do that
DoEvents
....what goes here
unload me
Try Exit.
As the last line of the batch file, anyway.
no cigar....does nothing
Use Sendmessage api and send WM_Destroy to the command prompt window. Also there's a tip on it somewhere you may search for it
If you are shelling the batch file through with codes, try the following:
' Win-NT: Shell ("cmd.exe /C [filename]")
' Win-95: Shell ("command.com /C [filename]")
The "/C" will terminate the dos window after it runs the batch file.
just found it...Nito:
the Environ("COMSPEC")function is suggested as it
will find the command com regardless of where it is
on a pc..ie..under D: or E: or whatever.
Thanks all .
Dim h As Long
h = Shell(Environ("COMSPEC") & " /C C:\Cleaner.bat")
DoEvents
That is great!
Do you mean that Environ("COMSPEC") is equivalent to cmd.exe or command.com?
Is "COMSPEC" a constant for Environ?
By the way, how did you get the envstrings like COMSPEC?
Nitro...it's command.com
it's from MS Help...
http://support.microsoft.com/support.../q161/3/03.asp