I wrote a php script and configured the task scheduler to run it every 10 minutes. The annoying thing is that every time the task runs, a command-prompt (svchost) window pops up for a few seconds.

How can I make it run silently?


It sounds as though you're running the script under the security context of your logged-on user. If you can get away w/ running the script as "SYSTEM" then you won't see the pop-up window. You can also make a dedicated user account with the least amount of privilege and run the script under that account (which is actually the right thing to do), but running it as SYSTEM can be expedious.


Eric Phelps wrote something on this a while ago: slightly dangerous playing around with windows script host and using wscript.exe to invoke your PHP command via the CreateObject("Wscript.Shell").Run method, I say slightly dangerous because Task Manager doesn't know about the shell and can't track it.



You can also just run that command prompt box minimized :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy