I would like to run a script that clears out the SCCM cache on a client computer automatically. To do this, I have written a simple batch file:

if exist %Windir%\ccmcache (
    RMDIR %Windir%\ccmcache /S /Q

I have deployed this as an "application" through SCCM. Basically I have created the deployment to run this script as the "uninstallation" of the program and chosen the detection method to check the existence of %Windir%\ccmcache on the client machine. The problem is that when it's trying to clear out the cache, the batch file that's running is stored in the cache and then it fails. I get the following error:

The software change returned error code 0x87D01106(-2016407290).

Is there any work around for this?

  • Don't check the box that says persist after installation? – Colyn1337 Dec 1 '15 at 19:45
  • That won't clear out the cache unless it fills up past the max. I have some large deployments like creative cloud to deploy and don't want 14GB just sitting on our users' hard drives – yhussain Dec 1 '15 at 19:51
  • 1
    You'll have to copy the .bat to somewhere outside of ccmcache. You might also have to invoke it indirectly from CcmExec which you should be able to achieve using some combination of scheduled tasks and psexec. – alx9r Dec 1 '15 at 21:11

You might try the Run Scripts functionality: Create and run PowerShell scripts from the Configuration Manager console

The biggest limitation is no scheduling available to the best of my knowledge (you also need to be on at least one of the last couple of current branch releases).

  • I know this is quite old but it would actually be better to just be run as a configuration baseline that runs periodically or as a package. Doing this as an application was not the smartest idea. – yhussain May 31 '18 at 20:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.