Getting error code: -1 when trying to run a script
We are trying to run a script to change a scheduled task but are running into issues. Below are the Powershell and bat files, along with the log file.
It is an offline Kscript, allowed to run without a logged-in user,
Any thoughts?
ps1:
If ((Get-ScheduledTask -TaskName 'ScheduledDefrag').State -eq 'Ready') { Disable-ScheduledTask -TaskName 'ScheduledDefrag' -TaskPath '\Microsoft\Windows\Defrag' } Get-ScheduledTask -TaskName 'ScheduledDefrag'
Bat: "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\97\DisableDefrag2012.ps1"
also tried: powershell.exe powershell.exe -ExecutionPolicy Bypass -Command "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\97\DisableDefrag2012.ps1"
1 Comment
[ + ] Show comment
-
We got it to work by starting over. Not sure what was wrong but it'd be nice to know why we got an error code: -1 in the Output log. - jgagnenu 8 years ago
Answers (0)
Please log in to answer
Be the first to answer this question