ID #1024

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)
Send("{ENTER}")
EndIf

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.

Tags: -

Related entries:

You can comment this FAQ