Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


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

24 Jun 2010   #1
Misfortune

Windows 7 Home Premium x64
 
 
Is There a Silent Command-Line Operation to change theme?

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:"C:\Windows\Resources\Ease of Access Themes\classic.theme"
(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 System SpecsSystem Spec
.
25 Jun 2010   #2
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (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


Attached Files
File Type: vbs ChangeTheme.vbs (383 Bytes, 9955 views)
My System SpecsSystem Spec
25 Jun 2010   #3
dunfiddlin

 

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 System SpecsSystem Spec
.

25 Jun 2010   #4
Misfortune

Windows 7 Home Premium x64
 
 
It Works!

@WindowStar

Thank you for making the script ! 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 System SpecsSystem Spec
25 Jun 2010   #5
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

I am glad that worked out for you. Enjoy!
My System SpecsSystem Spec
26 Sep 2011   #6
Lytchee

Windows 7 pro
 
 

Thanks WindowsStar.
Your script works pretty good on some french version of W7 with a little modification for names and keys.
My System SpecsSystem Spec
27 Sep 2011   #7
Mneighthyn

Windows 7 Professional 64-bit
 
 

Thank you WindowsStar
My System SpecsSystem Spec
16 Jan 2012   #8
josephpatrick

Windows 7 Enterprise x64
 
 

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 System SpecsSystem Spec
18 Jan 2012   #9
josephpatrick

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 System SpecsSystem Spec
18 Jan 2012   #10
josephpatrick

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 System SpecsSystem Spec
Reply

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




Thread Tools




Similar help and support threads
Thread Forum
I want to change realtek's sound format by using command line
Sound quality is changed by format, so I change the format many times. When I see a movie, then change to 24 48khz or 192. But many musics are 44.1khz so when I play music, then change to 24 44.1khz. But that click-work so bother me. So I want change format by command line. Could you tell...
Sound & Audio
Possible to Change Sound Scheme via Command Line?
Hello All, I've scoured and searched past threads, but have not found the answer(s) I'm looking for. Here's my situation: I'm a full-time AV technician and I frequently deal with multiple (sometimes hundreds) of rental computers that need to be set up for use with presentations. Using the...
Sound & Audio
How to change drive access permission using command line.
Hi, When I look on the Security tab of the drive's properties I see: Group or usernames: Authenticated Users SYSTEM Administrators (MyComputer\Administrators) Users (MyComputer\Users Now if I click on "Advanced" option. I get a page where I can change permissions for the users in the...
General Discussion
Command line to Change the colour depth.
I'm trying to automate changing the color depth.And i want to do it by one line. Kindly let me know the command line to change the color depth for 16bit to 32 bit and vice verse Thanks, Priya
General Discussion
Command Line Utility Change Sound Device
Hi! I am looking for a method for CLI-only changing of the default audio device. (Control Panel-> Hardware and Sound -> Manage Audio Devices) I have already tried various options such as AutoIT, AutoHotKey and while I was able to get it working, this was not the optimal solution. Does...
Sound & Audio
change color depth through command line
Hi, how to change color depth to 32-bit in windows through command or registry
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:11.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App