i tried two paths, the file did not create.
<?php
define(‘ROOTPATH’, __DIR__ . ‘\\’);
$path = ROOTPATH.’test01.txt’;
$myfile = fopen($path, “w”);
fwrite($myfile, “INI*****”.PHP_EOL);
fwrite($myfile, “FIN*****”.PHP_EOL);
fclose($myfile);
?>
<?php
define(‘ROOTPATH’,dirname(__FILE__) . ‘\\’);
$path = ROOTPATH.’test01.txt’;
$myfile = fopen($path, “w”);
fwrite($myfile, “INI*****”.PHP_EOL);
fwrite($myfile, “FIN*****”.PHP_EOL);
fclose($myfile);
?>
the code run successful on my local IIS (php only, no wordpress, no plugin), but nothing happens when Task Scheduler plugin execute the script (server on production).