Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to have a script that would change the current theme of Windows 7. I found the registry entry where this stored, but I apparently need to take some further action to get Windows to load the theme. What should I do?

Here is the script that I'm trying to use, but it isn't working (registry updated, but theme not changed):

######################################
# Change theme by updating registry. #
######################################

# Define argument which defines which theme to apply. 
param ( [string] $theme = $(Read-Host -prompt "Theme") )

# Define the themes we know about.
$knownThemes = @{ "myTheme" = "mytheme.theme"; "alien" = "oem.theme" }

# Identify paths to user themes.
$userThemes = " C:\Users\yoda\AppData\Local\Microsoft\Windows\"

# Get name of theme file, based on theme provided
$themeFile = $knownThemes["$theme"]

# Build path to theme and set registry.
$newThemePath = "$userThemes$themeFile"
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\"
Set-ItemProperty -path $regPath -name CurrentTheme -value $newThemePath

# Update system with this info...this isn't working!
rundll32.exe user32.dll, UpdatePerUserSystemParameters
share|improve this question
add comment

1 Answer

Have a look at the Stack Overflow question How do I change the current Windows theme programatically? dealing with the same issue. It seems like most commenters think you shouldn't be doing this at all (you may choose to ignore them). The other suggestions can be easily turned into a PowerShell script - just call the appropriate API functions.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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