Wednesday, September 07, 2011

Is there a Command-Line Operation to change Windows 7 theme?

 

Is there a way to change themes from the command-line, without showing the "Personalization" window? The command I use right now is

Code for Classic:

rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Ease of Access Themes\classic.theme"


or if you want the search bar, code for Basic:



rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"C:\Windows\Resources\Ease of Access Themes\basic.theme"


But this makes the "Personalisation" window pop up before changing the theme. There is a VBS that can open, then kill this window.



Set WshShell = WScript.CreateObject("WScript.Shell")



WshShell.Run "rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""C:\Windows\Resources\Ease of Access Themes\basic.theme"""



Wscript.Sleep 10000

WshShell.AppActivate("Desktop Properties")


WshShell.Sendkeys "%FC"


WshShell.Sendkeys "{F4}"



Or do this via the GPO:



image





Original article: http://www.sevenforums.com/themes-styles/93397-there-silent-command-line-operation-change-theme.html

No comments:

Blog Archive