VOGONS


First post, by Revolter

User metadata
Rank Member
Rank
Member

So I've been playing with various "shortcuts" in the form of batch files on my main (and only) retro config for some time: these disable Direct3D acceleration, or force a graphics card into 66/66 Mhz mode for 2D tasks (it's a Geforce 2 so it doesn't have low-power modes otherwise) and back to stock speed, or slow down and speed up the whole system, etc., and I love it!

What I've yet to understand, however, is:

- How to change a Windows theme (or just the wallpaper) from command line If it can be done by using a Registry switch, for example - it could also be incorporated into a batch file, which is my goal (to be able to visually change Windows environment when "emulating" another PC from my past by slowing down the P3 Celeron with Throttle). I've searched the Registry and tried a few things, but neither this nor Googling how to achieve that has helped much;
- Is it possible to disable/enable a device listed in the Device Manager from command line or Registry? What I want it for is to be able to turn off a USB Wi-Fi dongle during hot summer days when idling, so that it simply "lives" longer - as this thing does get quite hot to the touch at times (so I disable it anyways, but doing it every time from the Device Manager is tedious).

Thanks in advance for any advice or information on this!

Last edited by Revolter on 2019-09-01, 16:40. Edited 1 time in total.

Celeron 800, 512MB, GeForce2 MX, ES1938S/DB S2, Windows ME/DOS 6.22

Reply 1 of 11, by Caluser2000

User metadata
Rank l33t
Rank
l33t

My understanding is it is not possible. Regisatry changes can only be done within the gui enviroment. The command line tools are just not there compared to, say, linux .

There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉

Reply 2 of 11, by Revolter

User metadata
Rank Member
Rank
Member
Caluser2000 wrote:

My understanding is it is not possible. Regisatry changes can only be done within the gui enviroment. The command line tools are just not there compared to, say, linux .

Thanks for the reply.

What I'm using is a command of the following type:

REGEDIT /S C:\Folder\File.reg

This way you can easily modify Registry on the fly using a batch file/shortcut (of course as long as those modifications do not require a reboot to take effect).

The real question is which registry switches control this stuff, if they exist at all 😀

Celeron 800, 512MB, GeForce2 MX, ES1938S/DB S2, Windows ME/DOS 6.22

Reply 3 of 11, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

Windows has all of the power of linux in regards to the command line, and probably more tbh (namely I can control any mouse input/window operation from the command line and write ui macros... no point though since I have a mouse 😉). tbh I still practically live in the command line in Windows writing all of my automation in batch scripts (although I use powershell mostly, using unix commands 😉). Pretty much anything is possible from the command line in windows.

You can change (edit/add/delete) any registry key from the command line in windows using the "reg" command. You have to know the key you want to change. type "reg /?" for more info on how to use it. Be very careful as the wrong command syntax can stand a very good change of screwing your system permanently (rquireing reinstall). Always backup your registry in case this happens and then from a safe prompt you may be able to restore it.

To modify a reg key value see here: https://superuser.com/questions/607572/how-do … e-name-from-cmd

Eg in windows 10... To query the current key value for the wallpaper...

reg query "HKCU\Control Panel\Desktop" /f Wallpaper /t REG_SZ

To change the current wallpaper key value...

reg add "HKCU\Control Panel\Desktop" /t REG_SZ /v Wallpaper /d "D:\someWallpaperImage.JPG" /f

Changes the current wallpaper to "someWallpaperImage.JPG"... Requires restart though. This will change just the wallpaper image, there are other options such as tiling which are also key values you can change.

Look into "HKCU\Control Panel\Desktop" for all your user desktop settings. HKCU is shortcut for HKEY_CURRENT_USER.

As for the Device manager question, I can't say I have ever wanted to do something like that 😉... so you will have to look it up. If there is a registry key for it, use above command, however I have no idea or experience with the device manager stuff in that regard. You may have to add a reg key to ignore that device or disable or something. idk.

Reply 4 of 11, by Revolter

User metadata
Rank Member
Rank
Member

spiroyster, thanks for the reply.

Yeah, I'm familiar with modern Registry commands and switches, and I use them quite often at work and also to no-cd the crap out of all games I install to my PC that lacks a CD-drive 😀

However, Windows 9X family (95/98/98SE/ME) does not include the reg.exe part, unfortunately - it's only available in Windows NT family.

It does have the "HKCU\Control Panel\Desktop" part, though 😀 But yeah, changing the wallpaper path does nothing until a reboot occurs. Maybe there's some sort of "apply wallpaper change" action waiting to be made by poking a certain .exe somewhere?

Celeron 800, 512MB, GeForce2 MX, ES1938S/DB S2, Windows ME/DOS 6.22

Reply 5 of 11, by Caluser2000

User metadata
Rank l33t
Rank
l33t
spiroyster wrote:

Windows has all of the power of linux in regards to the command line, k

Windows 9.x doesn't. It's loaded on top of Dos. So the command line window is nothing like NT based windows cmd prompt window. Also you can't shell out of the gui to cli like you can on linuix and OS/2.
Dave Cutler wanted NT to boot to cli but Bill Gates said no.

Last edited by Caluser2000 on 2019-09-01, 20:34. Edited 1 time in total.

There's a glitch in the matrix.
A founding member of the 286 appreciation society.
Apparently 32-bit is dead and nobody likes P4s.
Of course, as always, I'm open to correction...😉

Reply 7 of 11, by Revolter

User metadata
Rank Member
Rank
Member
loblolly986 wrote:

Try the old Optimum X "Set Wallpaper" freeware program; it claims compatibility with Windows 95: http://www.optimumx.com/downloads.html#SetWallpaper

loblolly986, thank you so much! It works perfectly! 😀

If a utility like that exists, then it probably is hard to change a wallpaper from CMD natively.

Celeron 800, 512MB, GeForce2 MX, ES1938S/DB S2, Windows ME/DOS 6.22

Reply 8 of 11, by loblolly986

User metadata
Rank Newbie
Rank
Newbie

I believe certain Win32 API call(s) are needed to reload the wallpaper or color scheme on the fly, hence the need for such a program. I'm sure a similar program could be made for changing color schemes, or better yet to load a .theme file to change both and then some in one swoop. I don't recall off-hand if Microsoft's THEMES.EXE control panel program can do this from the command line but doubt it.

Reply 10 of 11, by Revolter

User metadata
Rank Member
Rank
Member

Kahenraz, oh, but it does! Thank you so much! Your neat element color software is all that was left to complete the set, as I only use themes for different wallpaper + colors, with same fonts and dimensions 😀

You've made my day, guys, thank you!

Celeron 800, 512MB, GeForce2 MX, ES1938S/DB S2, Windows ME/DOS 6.22

Reply 11 of 11, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie
loblolly986 wrote:

Try the old Optimum X "Set Wallpaper" freeware program; it claims compatibility with Windows 95: http://www.optimumx.com/downloads.html#SetWallpaper

Cool, what a useful set of tools. Nice find! 😀

Revolter wrote:

However, Windows 9X family (95/98/98SE/ME) does not include the reg.exe part, unfortunately - it's only available in Windows NT family.

Ah yes, apologies missed that. 😊

Not so experienced with using regedit (9x) from scripts. It's certainly messier as iirc you need to pass entries as files etc? but looks like you have that all in hand.

Also it turns out (unsurprisingly) that the device manager stuff is in the registry under HKLM. Useful to know but couldn't say more than that I'm afraid and that might get a bot messy as it seems you need to go by device GUID or some other abstract identifier.

Revolter wrote:

If a utility like that exists, then it probably is hard to change a wallpaper from CMD natively.

If you did want to avoid third-party stuff, I suspect the update call is in user32.dll as thats where the desktop/theme stuff has traditionally been... Dependency walker (on SetWallpaper.exe) will be able to isolate the call, and there stands a good chance it could be invoked by rundll without having to run SetWallpaper program, so you may be able to incorporate that into a batch script.
https://support.microsoft.com/en-gb/help/1647 … dll32-interface
Or maybe look into USER for updating.
https://en.wikipedia.org/wiki/Windows_USER
Thats only if you want to be a real purist, and if the correct function is exposed to RunDLL.... but yes SetWallpaper looks fine for this. very useful!

Caluser2000 wrote:
spiroyster wrote:

Windows has all of the power of linux in regards to the command line

Windows 9.x doesn't. It's loaded on top of Dos. So the command line window is nothing like NT based windows cmd prompt window.

I'm not following your response tbh. DOS (certainly since 6.22) has been as flexible as bash has ever been ime. Windows 9x supplies it's own DOS version (7.x). A COMMAND.COM is shipped with all versions of NT even today (which ultimately passes stuff to cmd.exe), so any batch script will work with NT command line interface the same way it did many years ago. While cmd.exe introduces new commands, it also supports all the DOS ones (through COMMAND.COM) and more importantly the syntax semantics (even on the new commands) are the same till this day. Couple this with stuff like RunDLL (mentioned above) which has been in Windows95 since day 0 afaik means you can script things that you need to write code for in linux. Not to mention scripts that go off piste, i.e call stuff not included in LSB, are less likely to work on any other nix other than your own.

Caluser2000 wrote:

Also you can't shell out of the gui to cli like you can on linuix and OS/2.

What benefit does this give? Personally I don't know why you would want to "shell out" of the GUI (I presume you mean exiting your window manager in Linux) when you could just run a terminal/command line from within the GUI and get the best of both worlds, be able to script GUI stuff and ultimately, not be restricted to console applications?