I have lot's of scripts that run, pushing various batch files, EXEs, and other scripts to our machines, and I want to clean up the Dependency Directory on a regular basis. I can do it multiple ways, but I was thinking create a batch file that deletes *.* in C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots on Win7+ machines, and delete *.* in C:\Documents and Settings\All Users\Dell\KACE\kbots_cache\packages\kbots on WinXP machines.

 

Can I just delete the "kbots" folder? Will the next script run create that for me?

1 Comment   [ + ] Show Comment

Comments

  • Depending on how you are creating your scripts. You can make then online shell scripts which give you the option to delete the downloaded files.

    If they need to be offline, I think the RMDIR option would be a good one to schedule and run monthly but you have check that it worked as the script you write would be in the directly you are deleting.
Please log in to comment

Answers

1

if you use the delete with the sub switch it will delete the files but leave the structure.

I used this kace script to cripple a laptop someone did not want to bring in to us.  When I got to look at it after she brought it back, it did what we wanted.  It nuked all of the not inuse/locked by sytem files but the directory layout was still instact.  Which crippled the machine.

  1. Launch c:\windows\system32\cmd.exe with params del c:\*.* /s /q /f.
  2. Launch c:\windows\system32\shutdown.exe with params /s /t 180 /f.
Answered 02/06/2014 by: SMal.tmcc
Red Belt

Please log in to comment
1

You can also try the RMDIR command. Something like:

rmdir /s /q C:\Documents and Settings\All Users\Dell\KACE\kbots_cache\packages\kbots\*

That will delete all the subfolders under kbots (and recurse into those as well) but leave the kbots folder itself

Answered 02/06/2014 by: BHC-Austin
Fourth Degree Black Belt

Please log in to comment
1

I thought and have experienced (not sure when it started), the past 3 agents at least do cleanup automatically over a period of checkins.  I know this because I have fought this with one particular script I have that depended on another script that delivered the binaries and extracted them as a prep script.

For us, we have to leave the machines in the label attached to that script in order to keep the bins on the machine.  Once the machine is taken out of the label it would evenualy do the cleaning.  However I have noticed some scripts not fully clean; mixed bag of results for sure.

Answered 02/07/2014 by: worzie
Second Degree Green Belt

Please log in to comment
This content is currently hidden from public view.
Reason: Removed by member request
For more information, visit our FAQ's.

Answer this question or Comment on this question for clarity
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja

Share