"Rob Campbell" <> wrote in message
news

84AB292-D053-424E-A521-...
> When a process works from the command line, but fails when run as a
> scheduled
> task, I usually look for permission issues with the account or accounts
> that
> are being used.
A further and often overlooked cause for such problems is "casual"
programming practices: Instead of fully qualifying all commands and files,
people tend to make assumptions that turn out to be invalid. In the current
case the OP assumes that the location of powershell.exe is listed in the
%path%. Perhaps it isn't. Robust programs would use code like this one:
"c:\Program Files\PowerShell\Powershell.exe" -command "&
'C:\ForceFree-Tape.ps1'".