Discussion:
Tip: how to disable the UAC from the command line
(too old to reply)
Marion
2025-02-05 10:49:24 UTC
Permalink
https://www.atera.com/shared-script-library/disable-user-access-control/
Disable
REG ADD
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v
EnableLUA /t REG_DWORD /d 0 /f
Enable
REG ADD
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v
EnableLUA /t REG_DWORD /d 1 /f
To add further value...

This is good information, where most of us, me included, rue the UAC but
recognize that it has value for the average person caught unawares.

A slightly more elegant way to get rid of the UAC for certain commands is
the trick to use the Windows task manager, which has an admin checkbox.

If you add more Windows tricks, you end up having commands that you can run
at will from the taskbar runbox, that you know won't bring up the UAC.

A simple example is the 1st one I had tried, oh, maybe 10 or so years ago.

1. Decide the command that you want to run without the UAC popups, e.g.,
C:\Windows\regedit.exe
2. taskschd.msc
Name = task regit
[x]Run with highest privileges
Actions = Start a program
Program: C:\Windows\regedit.exe
3. Create a taskbar runbox command named, oh, say, "regit" (or whatever)
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths
regit.exe===C:\path\to\regopen.lnk
4. Point the target of that shortcut link to the created task
TARGET=C:\Windows\System32\schtasks.exe /run /TN "Task Regedit"

Now when you click the pinned runbox icon in the tasbar and type:
Win+R > regit
Up pops the Windows registry opened to the last thing you did in it.
There is no bothersome UAC prompt.

Improvement: Whenever I run that command, the registry opens in the
background, already iconified on the taskbar. No big deal... but...

Q: Does anyone know how to make it open in the foreground instead?
A: ?
JJ
2025-02-05 22:09:22 UTC
Permalink
Post by Marion
Improvement: Whenever I run that command, the registry opens in the
background, already iconified on the taskbar. No big deal... but...
Q: Does anyone know how to make it open in the foreground instead?
A: ?
Use custom made WSH-VBScript script to activate the application window.
Loading...