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