Scripting Question

Is there a way to script the cleanup of the C:\ProgramData\Dell\Kace\Patches directory?

07/19/2016 1603 views

Is there a way to script the cleanup of the C:\ProgramData\Dell\Kace\Patches directory? 

Either from Kace or with a file I can leave on the desktop for me to manually run each month if this happens.

It's fine if I need to logon and run a script locally. Stop and starting the ampagent with a script is not a problem, I have batch files that handle the processes fine. But I'm unable to delete the contents of the Patches directory with a script.

Some errors could be: "C:\....\Konea.log" and "KONEA_STARTED"

The process cannot access the file because it is being used by another process.

But I can close that cmd window, manually highlight the contents of the Patches directory and delete them all without a problem.

I've tried del C:\ProgramData\Dell\Kace\Patches\*.* /F

And other variations of Del or PSFile but no luck so far.


0 Comments   [ + ] Show comments


All Answers

Create a script that runs on once a week or month and poke this registry command

reg.exe add  HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v delPatchDir /d "del C:\ProgramData\Dell\Kace\Patches\*.* /F /q /e"

next time the box reboots they will delete on startup.

Or create a script to do the run key if you want it to run every time the machine starts up.
Answered 07/19/2016 by: SMal.tmcc
Red Belt

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