Thursday 23 April 2015

Clear CCMCache Contents

Re-editing this old post from former blog, you could deploy it as a batch file to your SSP (Self-Service Portal) in SCCM Application Catalog page and allow the user to clear the content on their own instead of:



Here is the PS command, I added a "Force" parameter to it: 

#Removes the contents of CCMCACHE folder 

Remove-Item -Path C:\Windows\CCMCahce\* -Force -Recurse

Save the above PS commands as XXXX.PS1

The batch file that is required to run the above PS command: 

@ECHO OFF
SET PSScriptDir=%~dp0
SET PSScriptPath=%PSScriptDir%RemoveCCMCacheContents.ps1
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "& '%PSScriptPath%'";
pause

Make sure you save the above as XXXX.CMD

Save both files in the same directory (Less than 3KB) and you are ready to go!

Have Fun :) 

SY

1 comment:

  1. Remove-Item C:\Windows\ccmcache\* -recurse -force -exclude *.dat

    because skpswi.dat needs to be present there.

    ReplyDelete