nohup on windows, exec without waiting for finish

前端 未结 2 1439
耶瑟儿~
耶瑟儿~ 2020-12-06 08:03

Is there something like this for Windows?

exec(\"nohup /usr/bin/php -f sleep.php > /dev/null 2>&1 &\");
2条回答
  •  粉色の甜心
    2020-12-06 08:27

    It's not that hard (albeit with some minor differences)... You just need to use the WScript.Shell COM object:

    $shell = new COM("WScript.Shell");
    $shell->run($command, 0, false);
    

    That's it...

提交回复
热议问题