Changing visual styles from the command line?


Recommended Posts

Hello! I've just registered in this Forum, and as my first post, I wanted to make a question... It may seem difficult, or maybe strange, but I really need it, and, searching through the Forum, I've noticed that it was answered before. Sadly, the users who answered the question, pointed to an external page that now leads to a broken link...

So, I'll ask: Can you tell me how to change a visual style via the Command line or through a script?

Please, don't answer with things like: "Go to Screen properties and change the style from there", or "use Style XP, WindowsBlinds, etc..." I know perfectly how to use these programs, but now I need to know how to change it via a script or command.

Let me explain you: I'm curretly working on a shell theme for bblean (one of the BlackBox shell branches), making use of its new features. between one of them it's the ability to send commands to the windows core, and also, execute TCL-based scripts... So, I thought that it could be a great idea to create a matching visual style that could handle my windows and some other Explorer things, for each of my bblean Styles. Right now, I have both set of styles, and although changing them manually would be an alternative, I'd like to use an automatized way. I know it's possible, it was answered in this Forum some time ago. Thanks.

simple, change a few registry values.

[HKLM|HKCU]\software\microsoft\windows\currentversion\theme

String name:InstallTheme

Default String value: %resourcedir%\themes\luna.theme

String name:InstallVisualStyle

Default String value: %resourcedir%\themes\luna\luna\luna.msstyle

You can do this with the REG command.

Thanks to both of you... but I think that none of this solutions have worked fine for me. The one suggested by bigflavor seemed to be the most practical one, but then I discovered that, after updating in the registry, you must reboot in order to the change to take effect... :(

The program suggested by Herby was pretty useful, but it only throws up the Screen properties dialog with the theme you choose selected. The user still has to press the "Apply" button to execute the change.

Well, this wasn't exactly what I meant, but if I can't get any other solution to this issue, maybe I'll get along with Herby's solution, after all, I think that just a click isn't a great thing to do, after all.

Thanks again, I hope that someone could tell me if MMStlyler (the program I heard about in the other topic) can deal with the visual style change automatically.. or maybe any other solution.

I found a vbs file that does the trick @ gfxOasis :)

ApplyStyle.vbs

filename = "%WinDir%\Resources\Themes\Royale\Royale.msstyles"

delay = 300
myfile = Chr(34) & filename & Chr(34)

set DShell = CreateObject("WScript.Shell")

DShell.run "Rundll32.exe Shell32.dll,Control_RunDLL Desk.cpl Desk,@Appearance /Action:OpenMSTheme /file:"&myfile, 2
WScript.Sleep delay
DShell.SendKeys "{ENTER}"

ApplyTheme.vbs

filename = "%WinDir%\Resources\Themes\Royale.Theme"

delay = 300
myfile = Chr(34) & filename & Chr(34)

set DShell = CreateObject("WScript.Shell")

DShell.run "Rundll32.exe Shell32,Control_RunDLL Desk.cpl Desk,@Themes /Action:OpenTheme /file:"&myfile, 2
WScript.Sleep delay
DShell.SendKeys "{ENTER}"

ApplyStyle.zip

And to compliment those scripts:

You can use the following examples to replace the line that sets the filename (filename = "%WinDir%\Resources\Themes\Royale.Theme").

Change the word theme to style and replace in ApplyStyle.vbs.

Change 1:

The syntax would be ApplyTheme theme=[THEMEFILE].theme

filename = Wscript.Arguments.Named("theme")

Change 2:

The syntax would be ApplyTheme [THEMEFILE].theme

filename = WScript.Arguments.Item(0)

:rofl: flame.gif

http://www.microsoft.com/technet/scriptcen...a.mspx?mfr=true

Wow! :yes: This is exactly what I was looking for! It's simple, discrete, and does its work nicely! Now, i'm even thinking on setting up a routine through TCL to dinamically create the .vbs file, so I won't need to create one for every visual style... Well, maybe I'm going too far, but I'm really amazed that you could be able to find it, thanks Herby!

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Google are hyprocrites for signing this. They have been pulling the same dirty tactics as Microsoft, only they do it on Android and ChromeOS.
    • In some countries the law has forced Microsoft to display a menu on a fresh install of Windows which asks which web browser you want and it will install that browser. This doesn't add any bloat to Windows. It simply an additional step when setting up a new PC.
    • Chrome is also a first party browser on Android and ChromeOS. And on those systems, Google is pulling the same dirty tactics as Microsoft does on Windows.
    • Unofficial script lets you install unreleased Windows 11 features without Microsoft Account by Sayan Sen Microsoft has been steadily evolving the Windows Insider Program over the years, introducing new channels and testing paths that allow enthusiasts to experience upcoming and yet-to-be-released Windows features (some interesting hidden ones too) before they reach the public. However, one long-standing requirement has remained largely unchanged as users are generally expected to enroll in the Program and with a Microsoft account. That's where a third-party tool called "OfflineInsiderEnroll" can help. OfflineInsiderEnroll is said to be a lightweight script that enables access to Windows Insider Program builds on systems that are not signed in with a Microsoft account. Essentially the tool configures the necessary Insider settings locally and hence allows users to select and switch between available preview channels while continuing to receive builds through the normal Windows Update channel. If you are wondering how it manages to do so, it is made possible by a Registry value known as TestFlags. When configured to"0x20", Windows stops communicating with Microsoft's online Insider enrollment services thus preventing locally configured Insider settings from being overwritten. This allows the script to apply its own channel configuration directly through the Registry as Windows Update does not verify whether a device has been officially enrolled in the Insider Program or not. Previously the utility has had already supported the traditional Insider branches including Dev, Beta, and Release Preview. However following Microsoft’s recent restructuring of its preview channels, the script has now been updated. The latest OfflineInsiderEnroll version, 2.6.6, adds support for the newly introduced Insider channel lineup. As such, users can now choose from several Experimental channels in addition to Beta and Release Preview options. The update also retains tools for refreshing the Insider cache, resetting Insider settings, and completely stopping Insider enrollment when needed. Keep in mind though that will need elevated privileges when running the script (run as Admin). You can get the latest version of OfflineInsiderEnroll from this page on its official GitHub repo.
    • The "Classic" Outlook has done that for a few years as well. The option to even change that is really hidden away too... It really shouldn't be hard to respect user defaults. Sadly we are the product now, not Outlook. To change in the Classic Outlook: File > Options > Advanced > change "Open hyperlinks from Outlook in"
  • Recent Achievements

    • Week One Done
      Dr Jared Dental Studio earned a badge
      Week One Done
    • Week One Done
      RG INVESTMENT GROUP earned a badge
      Week One Done
    • Very Popular
      The Norwegian Drone Pilot earned a badge
      Very Popular
    • Very Popular
      s0nic69 earned a badge
      Very Popular
    • Collaborator
      Asgardi earned a badge
      Collaborator
  • Popular Contributors

    1. 1
      +primortal
      472
    2. 2
      PsYcHoKiLLa
      250
    3. 3
      Skyfrog
      79
    4. 4
      FloatingFatMan
      67
    5. 5
      Michael Scrip
      60
  • Tell a friend

    Love Neowin? Tell a friend!