0

I have scheduled a taks on my windows 7 machine to run every 15 minutes and I have that working.

The command is C:\wamp\bin\php\php5.3.5\php.exe -f "C:\wamp\www\vmstage.php"

Still, all working. When running that php script, it returns some text. Is it possible to keep cmd open for a few seconds so I can see what the result was?

Right now, the behavior is:

  1. cmd opens
  2. script runs
  3. waits for result (2-5 seconds)
  4. returns data
  5. cmd closes

1 Answer 1

2

There's a timeout command that will pause shell for some period of time or until you press a button. You can create a .cmd file with a content like that:

C:\wamp\bin\php\php5.3.5\php.exe -f "C:\wamp\www\vmstage.php"
timeout 5

.cmd files are just a lists of commands that are executed top to bottom. This one will execute your task and wait for 5 seconds. Schedule that file's execution instead of your current command.

3
  • is it possible to do the reverse? I want the execution of the php script to happen and then timeout
    – Ronnie
    Mar 28, 2013 at 20:11
  • nevermind, just tested it and it works. thank you! I'll accept in 5 mins. Won't let me yet
    – Ronnie
    Mar 28, 2013 at 20:12
  • You're welcome. I've edited the answer to be more clear and correct.
    – gronostaj
    Mar 28, 2013 at 20:14

Your Answer

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

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