** I’ve since learned how to achieve this using the new Configuration Manager 2012 Application method. See my post here to see how to do this. **
By default, the cache size set by Configuration Manager 2012 on the client is set to 5120MB.
So what if you wish to change this on the fly? I recently had cause to do just this thing. I recently had to deploy a rather large application that was over the cache size which meant that the installation failed.
I opened notepad and added the following text:
set oUIResManager = createobject("UIResource.UIResourceMgr") set oCache=oUIResManager.GetCacheInfo() oCache.TotalSize=10240
The example above will set the cache size to 10gb (10240MB)
Save the file with a .vbs extension and called it SetCache.vbs
I then created a batch file with a .cmd extension and added the following line to it:
I called this file SetCache.cmd
Because all files will be downloaded and run from the CCMCache on the client I used the %~dp0 command.
The %~dp0 (that’s a zero at the end) variable when referenced within a Windows batch file will expand to the drive letter and path of that batch file. For more info on this useful command (you will use it a lot in Configuration Manager) do a little research. If I have time I will make a post about it in more depth at a later date.
Place both the scripts on your server somewhere as you would for any other program or application.
In Configuration Manager I then created a program to deploy the Program to my collections:
Simply create a new Program that contains source files (browse to the folder where you have placed both the cmd and vbs scripts.) and deploy to the relevant computer collection. It’s almost instantaneous to make the change.