How to set System Cache upon Startup of a Windows 2003 server

In certain scenarios on Exchange 2007 servers, there may be the need to set the System File Cache on a server to prevent working set trimming scenarios due to other applications or processes running on the server. This can be any application or process that makes use of this Cache on the server. Note:  This blog entry was created as a reference in

Here are the steps how to do this.

  • Create a directory on your server to house the startup batch file. (Ex. c:\batch_files)
  • Download Cacheset from and extract it to the directory above.
  • Run Cacheset
  • Note the minimum working set value on the server (For Example, 1980 KB)
  • Close Cacheset
  • Calculate the maximum value by taking 10% of Physical RAM. You can use an online tool such as for help with determining this to simplify things. (For Example, if you had 24GB of physical RAM in the server, the value would be 25165824)
  • Create a batch file with the following contents and save it as setcache.cmd in the above directory

    C:\batch_files\cacheset.exe 1980 25165824

  • Since setting the cache using this utility does not survive a reboot, we need to find a way to enable this upon startup. We can do this with the built-in Schtasks utility that is part of Windows 2003. Open a command prompt and type the following:

    schtasks /create /tn "Set Cache On Startup" /tr "c:\batch_files\setcache.cmd" /sc onstart /ru ""

    Note: Specifying "" for the /RU switch, tells the task to run as SYSTEM.

    More information regarding this tool can be found in the following locations:

    Windows 2008 schtasks help
    Windows 2003 schtasks help

  • Before we can run cacheset using SYSTEM rights, we need to bypass the EULA acceptance, otherwise the utility will hang upon starting waiting for you to click the Accept button and this procedure will not work.. To workaround this, open up a command prompt interactively following these steps 
    • Open a command prompt
    • Note the current time in military time. For example, if it is 4PM, then this equates to 16:00.
    • Type at 16:01 /interactive cmd.exe making sure that the time you enter is at least one minute past the current time.
    • Wait for the command window to open.
    • Type c:\batch_files\cacheset.exe  and accept the EULA.
    • Close the command prompt.
  • To verify that the scheduled task has been added properly, type schtasks from a command prompt. This should return the 'TaskName" and the "Next Run Time" of "At system start up"
  • Reboot the server
  • If all went well, run the cacheset.exe utility manually to ensure that the cache size is set accordingly. The minimum and maximum values should match what you added in the setcache.cmd file.


Comments (6)

  1. Anonymous says:

    Thanks for sharing this information. I’m definitely going to try it on my computer at work ( ) and here at home! I love learning new computer tricks.

  2. Anonymous says:

    How do i set max cache size on win2008 64bit? I tried the SetCache.exe util i found on but cache just went over that setting like it wasnt even there. (yes i put a comment on that blog). Does anyone know if the Mark Russonovich util works on win2008? or some other way?

  3. Anonymous says:

    Unfortunately, on Windows 7, Windows completely ignores the values set by CacheSet and happily swaps all my programs to disk while it lets the cache gobble up all my RAM.

  4. Anonymous says:

    Excessive paging on Exchange 2007 servers when working sets are trimmed

  5. Annie says:

    Oh my cousin has been trying to do this all day. This makes so much more sense now that I have been listening to him all day. I am so happy I understand this a little more.

Skip to main content