|
Answer» Is there an easy way to close a Dos Command window from a batchfile? I made some SMALL batch files to run mspaint.exe, notepad.exe, calc.exe, etc from the Windows Start-Run command LINE.
EXAMPLE:
c:\winnt\system32\calc.exe
The problem is the Dos Command windows stays open. I want it to close as soon as the executable launches. Is there a way to close the Dos Command window and keep the executable running?start c:\winnt\system32\calc.exe exit
That doesn't work. The window is still open.What OS are you running? I'm using Windows XP and it works great.
Here is an article from MS$ about that: http://support.microsoft.com/kb/126410/EN-US/
When you don't use 'start' the window won't close until it's finished.
RegardsSay your BAT file is DoStuff.bat At the START/RUN line, you enter DoStuff DoStuff.bat, as suggested, is this: | start calc | exit
But the DOS window stays open. (Amazing. Doesn't happen on WindowsNT)
I assume DoStuff.bat is in your path. In other words, it is in a DIRECTORY that is accessable via START/Run.
What does it say at the top of the DOS window? On my system, it says | Microsoft(R) Windows NT(TM) | (C) Copyright 1985-1996 Microsoft Corp.
Maybe we can find the PIF file that you are using. If so, we will go to Properties/Program and ensure the box "Close on Exit" is checked.
Mac I'm using Windows 2000. The top of the batch file says the batch file name. There is no .pif file CREATED when I create the batch file.
I missed adding the "start" before hand, now it works. Thanks.Timrod - good man! Properly closed this thread.
thalisien - LOL - I got credit for your START idea.
Mac
|