Custom Task failing

(imported topic written by jpeppers91)

Any ideas why this is failing? The directory and the file are in there.

Completed if {exist file “c:\windows\system32\saveit.scr”}

Completed delete “c:\windows\system32\saveit.scr”

Completed runhidden rmdir /Q /S “c:\windows\system32\SaveIT dir”

Completed endif

Completed if {exist file “c:\winnt\system32\saveit.scr”}

Failed delete “c:\winnt\system32\saveit.scr”

runhidden rmdir /Q /S “c:\winnt\system32\SaveIT dir”

endif

(imported comment written by MattBoyd)

Is the file open? In this case, it would probably be if it is set as the screensaver and the system is idle… Try using something like this to kill the screensaver: waithidden taskkill /im saveit.scr /T /f

I’m not positive this will work.

(imported comment written by jpeppers91)

The screen saver is inactive.

(imported comment written by cstoneba)

haven’t tested it, but this is how I would do it:

if {exist file ((value of variable “Windir” of environment) & “\system32\saveit.scr”)}

waithidden taskkill /im saveit.scr /T /f

delete ((value of variable “Windir” of environment) & “\system32\saveit.scr”)

runhidden rmdir /Q /S ((value of variable “Windir” of environment) & “\system32\SaveIT dir”)

endif