Windows – How to hide ms-dos window when running a .bat file

batchbatch-filebatch-processingwindowswindows 7

I am running a .bat file for my script (Scheduled Tak (CronJob)) per minute. When it run, seems ms-dos window short period 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?

Best Answer

You can hide the window with a VB script:

Set objArgs = WScript.Arguments
For Each strArg in objArgs
    Set WshShell = CreateObject("WScript.Shell")
    cmds=WshShell.RUN(strArg, 0, False)
    Set WshShell = Nothing
Next

start c:\runHidden.vbs "C:\wamp\bin\php\php5.4.3\php.exe -f 'C:\wamp\www\tst\index.php'"