Page 1 of 1

Close CMD Window

Posted: 03 Jan 2017 08:40
by johnpc
How can I get the Cmd Window to close in the following batch file?


@ECHO OFF

cd "C:\Users\John\AppData\Local\Temp"

start %Temp%
cls

cd "C:\Program Files (x86)\CleanTempDirs"
start "CleanTempDirs.exe"

exit 0

cls

Re: Close CMD Window

Posted: 03 Jan 2017 08:52
by aGerman
The first parameter of START that is enclosed into quotation marks will be supposed to be the window title. Pass an empty string as first argument
start "" "CleanTempDirs.exe"

Steffen

Re: Close CMD Window

Posted: 03 Jan 2017 12:52
by Compo
you don't need to use CD or CLS either:

Code: Select all

@Start "" "%TEMP%"
@Start "" "%ProgramFiles(x86)%\CleanTempDirs\CleanTempDirs.exe"

Re: Close CMD Window

Posted: 08 Jan 2017 07:50
by johnpc
Thank You