Roger said:-

>Have you right clicked on the *.PIF file which runs the bat file
>or the shortcut or whatever you use to start the program and
>changed the properties to run with the window minimized?

Clint replied:-

>Yeah, that helps a little bit but the cmd window is still open. 
>Is there no way to have it close itself right after starting?

My suggestion:-

Right click the .pif as Roger suggested select Properties, then select the
Program tab.

Look for an option in the lower part of the dialogue box labelled 
"close on exit" and place a tick in the box.

For this to work, you will probably need to have the exit command as the
final line in your routine, following the execution of the commands you want
to use.

Just tried it out on a simple batch file and it worked OK.

The (trivial batch file reads:-
----------------------------------
@echo off
cls
echo.
echo Do you subscribe to PC Works?
echo.
choice /c:YN ?
if errorlevel 2 goto :end
if errorlevel 1 goto :whoopee

:whoopee
echo How clever!
pause
exit


:end
exit
----------------------------------

If you answer Y at the choice, you need to hit a key after the pause command
before exit terminates and closes the window.  If you choose N then the
window closes immediately.  Note however that the exit command isn't
executed until the previous commands have been dealt with.  If you wish the
batch file to start something, then close its own window I'm not sure
whether this will always work (may depend on whatever it is you are starting).

For example, I use a batch file (to do routine backups) which starts up a
utility called Power Archiver in command line mode and passes various
commands to it.  I have just tried adding the exit command to this batch
file (with the "close on exit" option enabled in the .pif window manager),
and the window dutifully closes when it has done its job, leaving Power
Archiver running.

Disclaimer:  I tried this out in the old fashioned DOS accompanying Windows
98 SE.  I have no way right now of checking whether the same options are
there with Windows XP's cmd window manager, but would hope this feature
hasn't been removed.

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

Reply via email to