How can I hide ms-dos window when running a .bat file?

user1845004 picture user1845004 · Nov 27, 2012 · Viewed 21.2k times · Source

I am running a .bat file for my script (Scheduled Tak (CronJob)) per minute. When it runs, windows command prompt appears for a fiction of time.

My batch code like this;

@ECHO OFF
C:\wamp\bin\php\php5.4.3\php.exe -f "C:\wamp\www\tst\index.php" 

How can I hide this window when it run?

Answer

Bali C picture Bali C · Nov 27, 2012

Use a VBScript

Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run("C:\yourbatch.bat"), 0, True

Run that which will run your batch file hidden.