Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Setting XP theme from a batch file

123 views
Skip to first unread message

Cryptogr...@yahoo.com

unread,
May 17, 2006, 6:55:43 PM5/17/06
to
Does anyone know how to change the windows theme with a batch file? I
have the .theme file do I just execute it?

zackrspv

unread,
May 22, 2006, 12:04:35 AM5/22/06
to
Simply executing a .theme file is not enough under XP.

However, if you can use a keyboard stuffer, or WSH you can change the
theme quite easily. One moment, and i'll post back with a batch
that'll do it, i'm just testing it out.

Just wanted to say that simply running the .theme doesn't work :)

zackrspv

unread,
May 22, 2006, 1:00:33 AM5/22/06
to
So, as promised:

This is tested on Windows XP SP1 & 2, This is a hybrid script, uses CMD
and WSH.

Few things you should know: New lines start with a line number (00X),
wrapped lines do not. Merge wrapped lines onto the previous line, and
remove line numbers before running the script.

You'll need to change the 'path' to your '.theme' file in the script to
make this work :) But, works fine for me :)

===Script: Theme.cmd===
001 @echo off
002 cls
003 set theme=%windir%\resources\themes\windows classic.theme
004 start %windir%\system32\rundll32.exe
%windir%\system32\Shell32.dll,Control_RunDLL desk.cpl desk,@Themes
/Action:OpenTheme /File:"%windir%\resources\themes\windows
classic.theme"
005 if exist _tmp.vbs del _tmp.vbs
006 ping -n 2 localhost > nul
007 echo set WshShell =
WScript.CreateObject^("WScript.Shell"^)>_tmp.vbs
008 echo WshShell.SendKeys "{ENTER}">>_tmp.vbs
009 _tmp.vbs
010 del _tmp.vbs
===End: Theme.cmd===

What it does:

Line 3 sets %theme% to the location of your '.theme' file (and all it's
supporting files, as with .theme's they are required to be within the
same directory).

Line 4 calls rundll32 to launch system32.dll and open the desk.cpl,
which is the Display Properties control panel applet. It then selects
the 'Themes' tab, and does the action of 'Opening' a theme.

Lines 005 -- 010 all have to do with the _tmp.vbs file, which is a
Windows Script Host (WSH) script that basically SENDS the 'enter' key
to the display properties window, which applies the theme.

Assumption: You have already installed the theme into windows.

If you have not installed the theme into windows, and are trying to
install a new theme, i'll have to redo the script for you :)

However, from your comments, you simply want to 'CHANGE' the theme, and
you have the location of the '.theme' file, which means to me that you
have already installed this theme into windows before.

Also to note, if you have Microsoft Plus! installed on your system, you
can launch the theme manager by using theme.cpl, however as i don't
have plus, i doubt that'll work as planned :)

Hope that helps.

0 new messages