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. Any ideas?

Here is the script that I'm trying to use, but 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

Thanks!

link|improve this question
feedback

1 Answer

Have a look at this StackOerflow question 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 PS script - just call the appropriate API functions. Good luck.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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