Is There a Silent Command-Line Operation to change theme?

Misfortune

New member
Member
Local time
12:47 PM
Messages
32
Is there a way to change themes from the command-line, without showing the "Personalization" window?

The command I use right now is
Code:
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:"[COLOR=Blue]C:\Windows\Resources\Ease of Access Themes\classic.theme[/COLOR]"
(where the blue text represents an example theme in an example location)

But this makes the "Personalization" window pop up before changing the theme. Does anyone know a way to perform this operation silently? This is a little like what Sudhir was asking earlier.
 

My Computer My Computer

OS
Windows 7 Home Premium x64
Here is a Script I wrote to close the dialog box. It will wait 10 seconds and then close the box, that should be enough time for the theme to take. -WS
 

Attachments

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
It can't ever be a totally silent process because of the need to shut down explorer and active processes and restart them. Your only option is to auto close the dialog as in the script above.
 

My Computer My Computer

OS
Windows 7
It Works!

@WindowStar

Thank you for making the script :D! After a bit of testing, I changed the waiting time to 1600, as I found that 10000 was a little too long of a wait. But other than that, your script works very well! Thank you, once again!

@dunfiddlin

I was afraid of something like that, but WindowStar provided a viable solution, as well. Thank you for the explanation :).
 

My Computer My Computer

OS
Windows 7 Home Premium x64
I am glad that worked out for you. Enjoy!
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Thanks WindowsStar.
Your script works pretty good on some french version of W7 with a little modification for names and keys.
 

My Computer My Computer

OS
Windows 7 pro
is it possible to trigger "changetheme.vbs" to be triggered when i launch a ".theme" file and then pass the name of the themefile as a parameter to this vbs script
 

My Computer My Computer

OS
Windows 7 Enterprise x64
I tried changing the script as follows:
--------------
Dim Arg, var1
Set Arg = WScript.Arguments
var1 = Arg(0)
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:""& var1"""
set Arg = Nothing
Wscript.Sleep 8000
WshShell.AppActivate("Desktop Properties")
WshShell.Sendkeys "%FC"
WshShell.Sendkeys "{F4}"
----------------------------------------------

and then passing argement as "changetheme.vbs" "c:\windows\resources\themes\test.theme" but it doesn't work.

Any ideas?
 

My Computer My Computer

OS
Windows 7 Enterprise x64
I was able to fix this by using the following code:
----------------------------------
Dim var1
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\themes\" & WScript.Arguments(0) & ".theme"""
set Arg = Nothing
Wscript.Sleep 8000
WshShell.AppActivate("Desktop Properties")
WshShell.Sendkeys "%FC"
WshShell.Sendkeys "{F4}"
-----------------------------------
and passing parameter as "changetheme.vbs" "test"

Now another question that I have is, is it possible to trigger this script when I double click on the ".theme" file?
 

My Computer My Computer

OS
Windows 7 Enterprise x64
Hello all:
I found this command doesn't work under Windows 8 Consumer Preview(Maybe this is a bug of Windows 8). Is there another solution to solve this problem?:(
 

My Computer My Computer

OS
Windows 8 Consumer Preview
Last edited:

My Computer My Computer

Computer Manufacturer/Model Number
Self built
OS
Windows 7 Ultimate x64
CPU
Intel Pentium Dual Core E5200 2.5GHz (3.77GHz OC)
Motherboard
Asus P5Q-E
Memory
Corsair 4GB DDR2 (4x1GB CM2X1024-6400C4)
Graphics Card(s)
Palit GeForce GTS 250 (1024MB)
Sound Card
On Board (ADI AD2000B 8ch HD)
Monitor(s) Displays
Samsung 32in LCD TV
Screen Resolution
1360x768
Hard Drives
2 x 1TB Samsung 103SJ (Raid0)
2 x External 500GB Samsung 502IJ (NexStar 3 HD Enclosures)
PSU
550W Antec Neo HE 550
Case
Antec P180
Cooling
Xigmatex Red Scorpion CPU Cooler. 3x120mm Fans
Keyboard
Logitech MX5000 Laser (Combo)
Mouse
Logitech MX5000 Laser (Combo)
Internet Speed
ADSL2+ (avg 10 Mbps Down, 0.80 Mbps up)
Other Info
Gigabyte GN-WP01GS 54g Wireless Lan Card
Currently I don't have Win8 CP installed anywhere to test. What is the error message? -WS
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
Is there a way to change themes from the command-line, without showing the "Personalization" window?

But this makes the "Personalization" window pop up before changing the theme. Does anyone know a way to perform this operation silently? This is a little like what Sudhir was asking earlier.


(Sorry for my bad English)

You can use Microsofts ThemeTool.exe for change the theme silently ...

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. You will be found ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Usage: ThemeTool.exe [options] [theme]

Options:
getcurrentthemename
getthemestatus
changetheme

Sample:
ThemeTool.exe changetheme C:\Windows\Resources\Themes\YourTheme.theme
 

My Computer My Computer

OS
Windows 7 Ultimate x64
ThemeTool.exe

@DrInSide
Thank you so much for your posting!!

(Sorry for my bad English)

You can use Microsofts ThemeTool.exe for change the theme silently ...

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. You will be found ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Usage: ThemeTool.exe [options] [theme]

Options:
getcurrentthemename
getthemestatus
changetheme

Sample:
ThemeTool.exe changetheme C:\Windows\Resources\Themes\YourTheme.theme

On Windows 7 Professional x64 w/SP1, I could not get the ThemeTool.exe to show up in that folder until I ran the RS_ColorTheme.ps1 with PowerShell, which was in that folder. The PowerShell script ended with an error, but it created the ThemeTool.exe file, which I copied out and works great. Here is the revised steps if you run into that same issue.

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. Right-click RS_ColorTheme.ps1 and choose "Run with PowerShell"
5. Close PowerShell window
4. You will find the ThemeTool.exe in this folder. Copy it into an other folder of your choice.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Professional x64
Antivirus
MS Security Essentials
Browser
IE, Firefox, Chrome
@DrInSide
Thank you so much for your posting!!

(Sorry for my bad English)

You can use Microsofts ThemeTool.exe for change the theme silently ...

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. You will be found ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Usage: ThemeTool.exe [options] [theme]

Options:
getcurrentthemename
getthemestatus
changetheme

Sample:
ThemeTool.exe changetheme C:\Windows\Resources\Themes\YourTheme.theme

On Windows 7 Professional x64 w/SP1, I could not get the ThemeTool.exe to show up in that folder until I ran the RS_ColorTheme.ps1 with PowerShell, which was in that folder. The PowerShell script ended with an error, but it created the ThemeTool.exe file, which I copied out and works great. Here is the revised steps if you run into that same issue.

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. Right-click RS_ColorTheme.ps1 and choose "Run with PowerShell"
5. Close PowerShell window
4. You will find the ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Hello,

does the themetool.exe after applying work with all new users? or this tool is just for the current user?

Thank you
 

My Computer My Computer

Computer type
PC/Desktop
OS
Rhone-Alpes
Does this work for changing the themes on Win 10 Build 10586

I have to change between day and night themes because after all the great engineering at MS they STILL haven't figured out that people don't like to stare at white during the night! ...and i just want to (quickly) flip the themes for different reading purposes.
 

My Computer My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 7 Ent. 64bit
CPU
AMD
Motherboard
MSI
Memory
32gb
Graphics Card(s)
Basic
Hard Drives
Several.
Antivirus
None
Browser
Chrome
Is there a way to change themes from the command-line, without showing the "Personalization" window?

But this makes the "Personalization" window pop up before changing the theme. Does anyone know a way to perform this operation silently? This is a little like what Sudhir was asking earlier.


(Sorry for my bad English)

You can use Microsofts ThemeTool.exe for change the theme silently ...

The tool will be created during troubleshooting of Aero theme:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and don't close it after finishing.
3. Search in C:\Windows\Temp a folder thats beginns with "SDIAG_".
4. You will be found ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Usage: ThemeTool.exe [options] [theme]

Options:
getcurrentthemename
getthemestatus
changetheme

Sample:
ThemeTool.exe changetheme C:\Windows\Resources\Themes\YourTheme.theme

EXCELLENT. Just a short note that for me on W7-64, in Step 2., I needed to click on the Aero troubleshooting link... just clicking on the general "Appearance and Personalization" troubleshooting tool did not create the subfolder [mentioned in Step 3.]. Also, if using custom themes they are in a different folder, and finally, custom themes cannot have spaces in the name or the tool won't work.

So DrInSide Steps Slightly Modified (bolded), if needed:

1. Go to Control Panel / Troubleshooting
2. Run "Appearance and Personalization" and then click on the Aero troubleshooting hyperlink and don't close it after finishing.
3. Search in C:\Windows\Temp a folder that begins with "SDIAG_".
4. You will find ThemeTool.exe in this folder. Copy it into an other folder of your choice.

Usage: ThemeTool.exe [options] [theme]

Options:
getcurrentthemename
getthemestatus
changetheme

Sample:
ThemeTool.exe changetheme C:\Windows\Resources\Themes\YourTheme.theme
(or for custom themes)
ThemeTool.exe changetheme C:\Users\[UserName]\AppData\Local\Microsoft\Windows\Themes\YourTheme.theme


Notes:
1. "AppData" is a hidden folder so you won't see it unless you have Windows configured to show hidden folders
2. Custom theme names cannot have spaces or they won't execute.
3. Placing this string in a bat file and then creating different bat files for different themes and executing them with Task Scheduler allows for changing themes on a schedule... such as a different custom theme for each day of the week, or one theme for the work week and another for the weekend, etc. The following steps used with the ThemeTool.exe above will switch themes without opening the Personalization window.

So assuming you have made custom themes in Windows (like by putting your own pics in the default wallpaper folders [under /Windows/Web/Wallpaper] and then compiling custom themes via Personalization... and saving those themes with unique names that have no spaces in them)... If you want themes to switch on a schedule Task Scheduler can be used in this manner:

1. Create a .bat file in the custom theme folder, which is located here:

C:\Users\[UserName]\AppData\Local\Microsoft\Windows\Themes\

assuming ThemeTool.exe has been copied to this folder, copy/paste the following in a text file, replacing the non-bolded text with your own:

ThemeTool.exe changetheme C:\Users\[UserName]\AppData\Local\Microsoft\Windows\Themes\YourTheme.theme

Then save the text file as (e.g.) Weekly.bat.

To have Task Scheduler run the .bat, type "task" in the search box, then click on Task Scheduler.

1. In the right pane, click on Create Basic Task.
2. Enter a name for the task such as WeeklyTheme.
3. Click Next and configure when you want the bat triggered (daily, weekly, etc)
4. Click Next and the Action screen will default to "start a program"
5. Click Next again and for Program/script, click Browse to navigate to the .bat file. When it fills it in, it will fill in the entire path. Copy the entire path EXCEPT the .bat file name, then delete the path and leave only the .bat file name in this field.
6. On that same screen, paste in the path you just copied, into the "Start in (optional)" field.
7. Tick the little box that says "Open properties when finished" then click FINISH.
8. Click the CONDITIONS tab and configure to taste.
9. Click the SETTINGS tab and configure to taste.
10. Click the GENERAL tab and conifgure to taste (can set privileges here).

Once the task is completed it shows up in the main window when ask Scheduler Library is highlighted at left. You can right-click the task to disable, delete, or to choose Properties to tweak its settings.

Create multiple batch files/themes/tasks for auto-switching the theme on any schedule.
 
Last edited:

My Computer My Computer

OS
Win 7 Ultimate 64-bit
Here is a Script I wrote to close the dialog box.... -WS

Thanks a lot for your script. On my computer it changed the design but couldn't close the dialog. Instead the address bar within the dialog was activated and dropped down, the window stayed open.
I changed the two sendkey commands to only one:

Code:
WshShell.SendKeys "%{F4}"
That did the job.
 

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Ultimate x64
I have yet to test this extensively but switching the timer from 10000 to 250 still worked for me with the added benefit that the personalization window is perceived as being never opened.

This is going to vary on people's system and how snappy their OS/Rig is. I'm running a brand new install on powerful rig when testing this. If you're running an old pc or your windows is really old or has tons of viruses slowing it down or is under a heavy load, 250 may be too little time. I wouldn't think it would go over 1000 and probably be around 500 for most. Ideally, if there a way of having the script wait for the personalization window to be active before closing it, it would take the guess work out of this.
 
Last edited:

My Computer My Computer

Computer type
PC/Desktop
OS
Windows 7 Pro x64 SP1
Back
Top