Powershell Script not running under scheduled task

Hi All,

If you will search for “Powershell Script not running under scheduled task” , you will find dozens of article .

There are number of ways to achive that I basically use batch file approach but the issue I am talking about is a bit different.

Only one of my powershell script was not working under scheduled task , it was working fine when I run it in command shell but as soon as I schedule it nothing happens.

After digging a bit I found the issue , I was using excel com object in the script so to make it work under scheduled tasks below are two options:

Option 1 –> Select  Run only when user is logged on when configuring scheduled task.

Option 2 –> Create a folder name Desktop under “C:\Windows\SysWOW64\config\systemprofile”

I have chosen option 2 as I find it best suited for my script to work seemlessly.

Note:- I have tested the solution on windows 2008..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s