Windows 7 Forums Search
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows 7. The Windows 7 forum also covers news and updates and has 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?

 
06-24-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
06-25-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, 4684 views)
My System SpecsSystem Spec
06-25-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
.


06-25-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
06-25-2010   #5


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


I am glad that worked out for you. Enjoy!
My System SpecsSystem Spec
09-26-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
09-27-2011   #7


Windows 7 Professional 64-bit
 
 


Thank you WindowsStar
My System SpecsSystem Spec
01-16-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
01-18-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
01-18-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? problems?



Thread Tools



Similar Threads for: Is There a Silent Command-Line Operation to change theme?
Thread Forum
Command Line Utility Change Sound Device Sound & Audio
change color depth through command line General Discussion
How to run a command line utility? General Discussion
Command Line General Discussion
Can you boot from the command line? Chillout Room


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



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
  

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