joeman1881 Posted August 8, 2016 Report post Posted August 8, 2016 Anyone know of the best method for clearing cache on a machine mid-OSD? I have a lab of machines I would like to deploy OS and some large apps (IE: CAD, Adobe CS, etc.), but don't have a ton of disk space, and would rather not clear post deployment. Thanks in advance! Quote Share this post Link to post Share on other sites More sharing options...
thadkew Posted August 9, 2016 Report post Posted August 9, 2016 Do you mean you want to clear out the temp directory? We have a step in our task sequence that removes and recreates the c:\temp folder (others as well) and cleans out the windows\temp folder. Just add a group called Cleanupin it, put a few Run Command Line steps with their commands: (For Cleanup c:\temp) cmd /c rd /s /q c:\temp (For Create c:\temp directory) cmd /c md c:\temp (For Cleanup c:\windows\temp) cmd /c del /f /q c:\windows\temp\*.* (For Cleanup c:\perflogs) cmd /c del /f /q c:\perflogs*.* (For Cleanup Windows Update directories) cmd /c del /f /q c:\windows\softwaredistribution\datastore\*.* & cmd /c del /f /q c:\windows\softwaredistribution\download\*.* (For Cleanup ConfigMgr logs) cmd /c del /f /q c:\windows\ccm\logs\*.* (For Cleanup Event Logs) powershell.exe -executionpolicy bypass -command "& {wevtutil el | Foreach-Object {write-host "Clearing $_"; wevtutil cl "$_"}}" Quote Share this post Link to post Share on other sites More sharing options...
joeman1881 Posted August 9, 2016 Report post Posted August 9, 2016 Do you mean you want to clear out the temp directory? We have a step in our task sequence that removes and recreates the c:\temp folder (others as well) and cleans out the windows\temp folder. Just add a group called Cleanup in it, put a few Run Command Line steps with their commands: (For Cleanup c:\temp) cmd /c rd /s /q c:\temp (For Create c:\temp directory) cmd /c md c:\temp (For Cleanup c:\windows\temp) cmd /c del /f /q c:\windows\temp\*.* (For Cleanup c:\perflogs) cmd /c del /f /q c:\perflogs*.* (For Cleanup Windows Update directories) cmd /c del /f /q c:\windows\softwaredistribution\datastore\*.* & cmd /c del /f /q c:\windows\softwaredistribution\download\*.* (For Cleanup ConfigMgr logs) cmd /c del /f /q c:\windows\ccm\logs\*.* (For Cleanup Event Logs) powershell.exe -executionpolicy bypass -command "& {wevtutil el | Foreach-Object {write-host "Clearing $_"; wevtutil cl "$_"}}" Thank you for the reply, I appreciate it! I think these commands will come in handy going forward. We probably should be cleaning things up for all deployments whether space is an issue or not. Quote Share this post Link to post Share on other sites More sharing options...
anyweb Posted August 10, 2016 Report post Posted August 10, 2016 you might want to consider adding a delay of a week or so to the cleanup of some folders, for example C:\Windows\Temp as many applications logs are logged to their or the appdata\local\temp equivalent, so troubleshooting failed installs of apps might be a challenge if the logs are deleted, just a thought Quote Share this post Link to post Share on other sites More sharing options...
joeman1881 Posted August 30, 2016 Report post Posted August 30, 2016 you might want to consider adding a delay of a week or so to the cleanup of some folders, for example C:\Windows\Temp as many applications logs are logged to their or the appdata\local\temp equivalent, so troubleshooting failed installs of apps might be a challenge if the logs are deleted, just a thought I just saw this reply, but that's actually a good thought, because I do reference those logs fairly often. Thanks for the reply! Quote Share this post Link to post Share on other sites More sharing options...