Powershell script cannot access a file when run as a Scheduled Task

前端 未结 3 1393
别跟我提以往
别跟我提以往 2020-12-09 11:07

My Powershell (2.0) script has the following code snippet:

$fileName = \"c:\\reports\\1.xlsx\"
$xl = new-object -comobject excel.application
$xlFormat = [Mic         


        
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 11:35

    The solutions above didn't work in my SCSM 2012 Scorch environment, instead I used PSExcel (https://github.com/RamblingCookieMonster/PSExcel) which has no dependency on having Excel installed or the ComObject.

提交回复
热议问题