Home Dashboard Directory Help
Search

Scheduled Task for Powershell does not observe the Tasks "start in" directory by Craig S Williams


Status: 

Active


1
0
Sign in
to vote
Type: Bug
ID: 771860
Opened: 11/21/2012 9:25:18 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Not sure if this is defect of the Task Scheduler or Powershell.
Using psv2 on 2008R2.
When the task "program" is "powershell" the "Start in" path is observed and the $pwd of the script execution is the "start in" dir
However, when the task "program" is "powershell.exe" the "Start in" path is NOT observed and the $pwd of the script execution is C:\windows\system32
So when the script writes to a file, and you expect the current dir to be the "start in" dir, it is not unless you remember to make the tasks "program" = "powershell" without .exe
Details
Sign in to post a comment.
Sign in to post a workaround.