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

    • Ladybird Browser is no longer accepting outside contributions thanks to AI by David Uzondu The Ladybird Browser Project has announced it will no longer accept public pull requests and will limit changes to those made by its maintainers as it works towards its first alpha release. According to Ladybird's creator Andreas Kling, this is "not a change we make lightly," but the rapid shift in AI capabilities forced their hand. Previously, a massive PR implied that the person behind it put a lot of care into the code and is ready to "answer for the consequences." Now with AI, anyone can generate a PR without even understanding the bug fix or feature they want merged. The blog post goes on to say that the team is closing all open public pull requests immediately, and that maintainers will not treat external forks as a review queue for upstream Ladybird. Instead, the team wants outside contributors to focus on reporting bugs and running tests. Kling started Ladybird back in 2019 as LibHTML, a simple HTML viewer for his hobby operating system, SerenityOS, but by September 2022, it had turned into a full-fledged browser project. What sets Ladybird apart from the likes of Google Chrome, Apple Safari, or Mozilla Firefox is its totally independent engine, which does not rely on pre-existing codebases. The project maintains a strict policy against default search engine deals or user data monetization, keeping development funded entirely by donations and sponsorships. Generative AI is forcing open source project maintainers to rethink how they handle public code contributions (and the whole open-source thing in general). One month ago, a leak about the National Health Service (NHS) suggested the organization was planning to take all of its public repositories private ahead of a May 11 deadline, thanks to Mythos (an AI model that Anthropic believes is too dangerous to be released to the public) and its ability to find and write exploits for zero-day vulnerabilities. Thankfully, the Government Digital Service (GDS) issued a counter-report titled "AI, open code and vulnerability risk in the public sector" that stopped the shutdown by pointing out that hiding code does not improve security.
    • Kalmuri 4.2.4 by Razvan Serea Kalmuri is your all-in-one, portable screen capture and recording solution designed for speed, simplicity, and flexibility. Whether you need a full-screen snapshot, a custom area, a scrolling webpage, or smooth video recording, Kalmuri delivers with ease. Capture text instantly from images with built-in OCR, keep floating images on top for quick reference, and use the precise color picker for perfect design matching. Customize hotkeys to work your way and share results instantly with built-in upload options. Kalmuri runs without installation, making it ideal for USB use, and offers an intuitive interface that’s easy to learn. Kalmuri key features: Video recording support (designation of whole screen and area) Whole screen, active program, window control, area application Extract text from images using optical character recognition (OCR). Support for PNG, JPG, WEBP, BMP, GIF file formats MP4 video recording powered by FFmpeg for high-quality results Full web page capture Share the captured image on the web Color extraction function Printer output Hotkey settings Adjustable via keyboard for area capture (Arrow key, Ctrl+Arrow key, Shift+Arrow key) File name format (sequential, datetime) Free to use it at work, at home, in government offices, at school, etc. Using Kalmuri portable for video recording Kalmuri’s portable version doesn’t include FFmpeg, which is required for video recording. Without it, you’ll get an “error FFmpeg.exe not found” message. To fix this, download FFmpeg from the provided link, extract it, and place FFmpeg.exe in Kalmuri’s folder. Kalmuri will then recognize it automatically, allowing you to start recording in high quality instantly. Kalmuri 4.2.4 changelog: Fixed an issue where color picking could occasionally freeze Improved capture stability Resolved a possible unexpected app shutdown in certain cases Refined internal handling for a smoother experience Download: Kalmuri 4.2.4 | 24.2 MB (Freeware) Download: Kalmuri Portable 4.2.4 | 2.1 MB View: Kalmuri Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I like the show more options. The only problem with it is that it's not always in a consistent spot in the menu. If the copy/paste/cut, happens to show on top, then more option is the last in the menu. But if copy/paste/cut happens to show on the bottom, then more options is before the copy/paste/cut. But I do like the more options because it hides the stuff that I rarely use. But I would like to choose what it is or isn't hiding. That would make it better.
    • I wonder if "put it back the way it was for decades" ever crossed their minds? 🤣
    • Rescind the stupid "Show more options" in context menus and just give us the full menu instead of adding more steps to get to what we want. The "simpler by default" makes me think they'll go in the opposite direction. Every context menu should have a configure button so you can pick and choose what options should be shown, I know you can do that with some registry fu but that shouldn't be required.
  • Recent Achievements

    • Week One Done
      I2D earned a badge
      Week One Done
    • 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
  • Popular Contributors

    1. 1
      +primortal
      476
    2. 2
      PsYcHoKiLLa
      253
    3. 3
      Skyfrog
      81
    4. 4
      FloatingFatMan
      64
    5. 5
      Michael Scrip
      62
  • Tell a friend

    Love Neowin? Tell a friend!