Automating performance optimizations for Windows Media Center


I recently stumbled across a KB article that lists some performance optimization tips and tricks for Windows Media Center and I also saw some of the steps that we recommend to folks inside of Microsoft, which are roughly the same as the KB article.  What seems to be missing from all of these performance recommendations is steps for how to automate these steps.  Here are ways to run some of the key Media Center performance optimization steps automatically so that it can be scripted and run as a scheduled task if desired.


Run Disk Defragmentation



  • %windir%\system32\defrag.exe <drive letter>

Run Disk Cleanup



  • %windir%\system32\cleanmgr.exe /d <drive letter>

More info about command line options for disk cleanup can be found in this KB article


Remove Temporary Files



  • rd /s /q *.tmp

Remove Memory Dump Files



  • rd /s /q *.dmp

Disable System Restore


System restore monitors system changes and saves the system state as a restore point.  These restore points are created when any hotfix is installed and in other scenarios, and the files they use to store system state cannot be defragmented using the utility listed above.  Therefore, you may want to disable system restore by setting the following registry keys/values:


Registry Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SystemRestore
Registry Value: DisableSR
Data Type: REG_DWORD
Value Data: 1


Registry Key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\sr
Registry Value: Start
Data Type: REG_DWORD
Value Data: 4


Disable Disk Indexing


Disabling disk indexing is one of the optimization steps not listed in the current KB article for Media Center performance.  However, I have not been able to find a way to disable disk indexing automatically, but it can be done with these steps.  If anyone reading this knows how to automate disabling disk indexing, please post a comment!



  1. Navigate to My Computer 

  2. Right click on each drive letter and choose Properties 

  3. Uncheck the item labeled Allow Indexing Service to index this disk for fast file searching and click OK 

  4. Choose the radio button labeled Apply changes to <drive letter>, folders and files and click OK

 

Comments (3)

  1. Brad C. says:

    Disabling System Restore via a registry key may work on current systems. In light of recent articles regarding future-proofing, might I suggest a better way to disable SR would be to use a supported WMI call: http://msdn.microsoft.com/library/en-us/sr/sr/disable_systemrestore.asp

    Technet even has a sample script:

    http://www.microsoft.com/technet/scriptcenter/scripts/desktop/restore/dmsrvb03.mspx

  2. Darrel says:

    I have looked into these automations, and I would like any more info you could give. I got cleanmgr working automatically using sageset and sagerun, but I am wondering if there is any way of knowing exactly how/what to delete to make media center work more smoothly. I also would like to know more things about automating media center tune-up. Is there a way to automate taks which will not interfere with media center tasks, or do you simply need to schedule them to happen when you think media center isn’t busy?

  3. Hi Darrel – I don’t know of a way to come up with an exact list of things to delete with cleanmgr.  The most likely locations to affect Media Center from the list at http://support.microsoft.com/kb/q253597/ (the cleanmgr knowledge base article) are the Temporary Internet Files and Recycle Bin.

    For your scheduling question – I would suggest that you schedule all of these clean-up activities for a time when you don’t think your computer will be used at all (either by Media Center or by any other processes you might use on your system).  Normally, I schedule this type of activity for the middle of the night (such as 3am, which for me is when I know I’ll ordinarily be asleep).

Skip to main content