Run minimized or hidden PHP script by Task Scheduler

Asked

Viewed 857 times

2

I have a scheduled task in windows (working perfectly), where you run a PHP script:

Scheduler:

tarefa

email php.:

<?php
require_once 'classes/core.class.php';

set_time_limit(120);

$tempo1 = microtime(true);
$core = new Email();
$core -> enviaEmails();
$tempo2 = microtime(true);

echo '<br> tempo: ' . $tempo2 - $tempo1;
?>

The problem is, all the time the window of cmd, runs the script, finishes and closes. As this task is executed several times in a short time, it gets in the way when working on other tools.

I wonder, how do I "hide" that window, or at least start it minimized?

  • Which user is using to run the script?

  • @Gabrielheming The Adm of the same machine.

  • Switch to System or System user.

  • 1

    @Gabrielheming perfect! Assemble the answer so I mark as solved. I will also add an image in it. Thank you!

  • just check "run whether or not user is logged in"

  • @Rovannlinhalis also worked expensive! I was only left with doubt about the flag "Do not store the password. The task will only have access to the resources of the local computer." This would be to avoid changing the user password, and stop scheduling?

  • 1

    Among other things... On the question, I think it has nothing to do with php... But as a Windows feature... You have to remove the tag there... Maybe even close as out of scope

  • She came out of that: PHP script scheduling in Windows, but quiet! For me you can close!

Show 3 more comments

1 answer

2


As informed on next topic, just use the execution user as SYSTEM or SISTEMA (depending on the operating system language).

tarefa

Another solution, presented in the above linked topic and also by the comment of @Rovann Linhalis, is to check the option "run whether user is logged in or not" (Run whether user is logged on or not).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.