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

    • An excellent piece of hardware held back by its OS
    • A new wallpaper... high définition... I know ! this one really cleared my skin, it boosted my crops and grew my hair an extra inch.
    • All I want is a way to turn off the Copilot AI suggestion crap in OneDrive that doesn't break OneNote, etc. -- as the current Account setting change option does...
    • Here is the new Surface Laptop Ultra wallpaper in high resolution by Taras Buria Earlier this week, Microsoft announced the Surface Laptop Ultra, its brand-new high-end laptop powered by NVIDIA's brand-new RTX Spark processor. As usual, Microsoft gives each new device a unique wallpaper, and the Surface Laptop Ultra is no exception. While the device is not publicly available yet, somebody has already extracted its wallpaper, giving everyone a chance to get a piece of the upcoming laptop in its full-resolution glory. The Surface Laptop Ultra has a very dark, abstract wallpaper that resembles the stock wallpapers in Windows Server, albeit with much less color. Having this dark, grim wallpaper highlights the laptop's mini-LED display and its ability to cut off parts of the screen's backlight to achieve OLED-like black levels. However, if you also like light wallpapers, we made a white version by simply inverting its colors. You can download both wallpapers below (click the image, right-click it, and select "Save as"): The Surface Laptop Ultra is expected to launch later this year. Microsoft is not revealing full details yet, including the price. However, Microsoft confirmed up to 1 petaflop of AI performance and RTX 5070-level of GPU performance. The heart of the laptop has up to 20 CPU cores and 6,144 GPU cores. Additionally, Microsoft and NVIDIA boast high CPU efficiency for all-day battery life. As for the display, it is a 15-inch mini-LED display with a pixel density of 262 ppi and a maximum brightness of 2,000 nits. Of course, not everyone needs this amount of power, and certainly not everyone can afford it. For those who need a more affordable device, Microsoft is also preparing the next-generation Surface Pro powered by the Snapdragon X2 Elite processor. Weeks ahead of the announcement, details about this computer were leaked by a retailer. Do you like the Surface Laptop Ultra's stock wallpaper? Share your thoughts in the comments. Image provided by @nextgenos2026 on X
  • Recent Achievements

    • Apprentice
      fernan99 went up a rank
      Apprentice
    • One Month Later
      nothanks earned a badge
      One Month Later
    • One Month Later
      B2Proxy earned a badge
      One Month Later
    • One Year In
      MadMung0 earned a badge
      One Year In
    • Week One Done
      jefred earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      475
    2. 2
      PsYcHoKiLLa
      233
    3. 3
      Skyfrog
      79
    4. 4
      FloatingFatMan
      68
    5. 5
      Michael Scrip
      58
  • Tell a friend

    Love Neowin? Tell a friend!