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

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

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, 8988 views)
My System SpecsSystem Spec
25 Jun 2010   #3

 

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

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

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

Windows 7 pro
 
 

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

Windows 7 Professional 64-bit
 
 

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

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

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

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 for2: Is There a Silent Command-Line Operation to change theme?
Thread Forum
How to change drive access permission using command line. General Discussion
Command line to Change the colour depth. General Discussion
How can I set this via command-line or registry? Customization
Gpedit via command line Performance & Maintenance
Command Line Utility Change Sound Device Sound & Audio
change color depth through command line General Discussion
Command Line 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 08:37 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33