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

Page 1 of 3 123 LastLast

  1. Posts : 32
    Windows 7 Home Premium x64
       #1

    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 Computer


  2. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #2

    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
    Is There a Silent Command-Line Operation to change theme? Attached Files
      My Computer


  3. Posts : 190
    Windows 7
       #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 Computer


  4. Posts : 32
    Windows 7 Home Premium x64
    Thread Starter
       #4

    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 Computer


  5. Posts : 2,737
    Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
       #5

    I am glad that worked out for you. Enjoy!
      My Computer


  6. Posts : 1
    Windows 7 pro
       #6

    Thanks WindowsStar.
    Your script works pretty good on some french version of W7 with a little modification for names and keys.
      My Computer


  7. Posts : 1
    Windows 7 Professional 64-bit
       #7

    Thank you WindowsStar
      My Computer


  8. Posts : 7
    Windows 7 Enterprise x64
       #8

    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


  9. Posts : 7
    Windows 7 Enterprise x64
       #9

    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


  10. Posts : 7
    Windows 7 Enterprise x64
       #10

    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


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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 06:31.
Find Us