/build/static/layout/Breadcrumb_cap_w.png

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"
61tZzY.png

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)

Be the first to answer this question

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ