How can I change the current theme in XP using Autoit?

The following will change the theme to royale and activate it without having to reboot or refresh the screen. The Royale.exe theme is a zipped executable that you can unzip with a program like 7zip, then copy each folder to its appropriate location in windows.

i.e.; unzipped Royale will have a Royale folder with Resources and Web Folders. These correspond with the same folders in your windows directory: c:\windows\Resources & c:\windows\web.

This Autoit script snippet will do the trick:

;install Royale Theme if XP
if @OSVersion = "WIN_XP" Then
$source = "yourfilelocation\Royale"
$dest = @WindowsDir
DirCopy($source, $dest, 1)
Run(@COMSPEC & " /c " &"%windir%\resources\themes\Royale.Theme","",@SW_HIDE)
WinWait("Display Properties", "",3)

This is simpler than what I found out there even on Autoit forums. They tried calling dlls to do this, but is unnecessary as Windows already knows how to open up a .theme file. THE Run(@COMSPEC & " /c " &"%windir%\resources\themes\Royale.Theme","",@SW_HIDE) COMMAND is simpler as it calls the .theme file you need which windows launches the display property, changes the theme to that one in the command, then you can manually click OK or use the send {Enter} as in the snippet above.
Last update:
2012-03-16 23:10
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.