Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

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'"
share|improve this answer
    
Thank you @Micro Tolts –  prestack Nov 27 '12 at 14:11

You can use start /min <your command> which will not hide window but will minimize it.

share|improve this answer

In Task Scheduler, you may create a task that will run in another user account. If done so, the batch window won't appear in your own login.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.