In Windows it is possible to set the theme from the command line, instead of using the Themes tab of the Display Properties control panel applet. This makes it amenable to scripting, which can be useful when your theme settings are not saved after you log out, for whatever reason.
If a shortcut to the following WSH script was placed in your startup folder, then the given theme would automatically be loaded when Windows started. Note that you must have previously saved your desired theme, and that you must edit the script to point to this saved theme.
//===================================================================
// FILE: theme.js
// DESCRIPTION: automatically set the Windows theme
//===================================================================
// create shell object
objShell = new ActiveXObject("WScript.Shell");
// start themes applet, load desired theme, and activate this window
objShell.Run('rundll32.exe Shell32.dll,Control_RunDLL desk.cpl desk,@Themes /Action:OpenTheme /File:"C:\\temp\\Happy.theme"',1);
// wait for themes window
WScript.Sleep(1600);
// send the 'enter' key to accept this theme
objShell.Sendkeys("{ENTER}");
As themes encompass Window appearance, this method will also set 'Windows and buttons' in the Appearance tab to 'Windows XP style' or 'Windows Classic style'. There may be an easier method to do just this change without loading a whole theme, but I could not find any official documentation for the Shell32.dll options.
Update 12 Feb 2007: The obvious way of just changing the 'Windows and buttons' from Windows Classic to Windows XP style is by emulating keypresses. XpStyle.js does that, and also changes from Default (blue) to Olive Green. If this is the only outcome you are after, then this method is preferable to changing the theme because that requires the use of a saved theme, and because themes store much more than just the Windows and buttons style.