/build/static/layout/Breadcrumb_cap_w.png

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

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.


Thanks



0 Comments   [ + ] Show comments

Answers (1)

Posted by: SMal.tmcc 8 years ago
Red Belt
1
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.
 
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