I have a PHP script that runs a process to generate letters on a Windows server. The file is current set up as a Scheduled Task.
In the script, the COM object is instantiated to work with the appropriate files. When it is run as a Scheduled Task, the line to instantiate the COM object does nothing and hangs the script (rather than returning any result). The script will never terminate.
$this->word = new COM("word.application");
I believe that there is no issue with the script itself, as I can run the batch file directly (with no issue). This problem only seems to come up when we try to automate it.
I think there is some permissions issue going on, but I’m not entirely sure.
Thanks for any help!
Edit:
More information about the system:
Windows 2008 Server Standard without HyperV
Microsoft Office Word 2007
PHP 5.3.10
Attempting to Automate
I have found the solution. It was a profile issue.
In:
check to see if the
Desktopfolder exists.If it doesn’t, create it.
It has this issue because it is expecting the folder, but hangs when it can’t find it.