PowerShell scheduled task to run script with Excel Com Object

Viewed 1468

Here is some strange behavior, I've got a PowerShell script that converts an XLSX file into a CSV file. This script runs in the console without issue.

Trying to schedule the task/script results in a CSV file with no data (0 Bytes).

In my searching, I found this TechNet forum post that proved helpful.

Essentially the scheduled task containing the Powershell script that uses the Excel ComObject fails because You have to create a folder (or two on a 64bit-windows). Once this was done, the task when run manually works as expected. It also works when a trigger is set and the user is logged off.

Is this type of behavior concerning the Excel ComObject documented anywhere at all? I spent 3 hours trying to get this to work.

C:\Windows\System32\config\systemprofile\Desktop

(64Bit)

C:\Windows\SysWOW64\config\systemprofile\Desktop
2 Answers
Related