• Tip: how to disable the UAC from the command line

    From T@21:1/5 to All on Tue Feb 4 19:31:27 2025
    Hi All,

    I was remoted into a customer;s computer with AnyDesk trying
    to help her with some things.

    The &%*&ing UAC kept popping up on commands I was trying
    to run. I had to keep calling her to click YES.

    I got pissed and:

    -T


    How to disable/enable the UCA from the command line:

    Reference: https://www.atera.com/shared-script-library/disable-user-access-control/


    Admin cmd:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marion@21:1/5 to All on Wed Feb 5 10:49:24 2025
    XPost: alt.msdos.batch

    On Tue, 4 Feb 2025 19:31:27 -0800, T wrote :


    How to disable/enable the UCA from the command line:

    Reference: https://www.atera.com/shared-script-library/disable-user-access-control/

    Admin cmd:
    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: ?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Newyana2@21:1/5 to All on Wed Feb 5 08:45:30 2025
    On 2/4/2025 10:31 PM, T wrote:


    Admin cmd:
       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


    That's a good one. It's actually a further de-restriction
    from UAC. UAC -- user account control -- can be changed
    in the user settings. But the lowest setting is still restricted.

    LUA stands for limited user account. I discovered it because
    I was trying to drop a folder onto a path field in my own software.
    My program was started as admin because it changes ownership
    and permissions of files and folders. I found that I was unable
    to drop a folder to extract the path and avoid a browsing
    dialogue. (I had built in the simple and nearly universal function
    of getting the path of a dropped object and getting its path,
    to save steps.)

    After some research I discovered LUA and that it's supposed
    to block dropping from lower to higher status processes!
    Disabling LUA fixes that. But MS have made great efforts to hide
    it. The setting does not normally exist. And if you open user
    settings, even doing nothing, and click anything but Cancel to
    close that window, LUA will be re-activated.

    Since I discovered it, it's one of the first fixes I apply to any
    new install. It just causes hassles without providing any
    security that I'm aware of. Of course, if you normally run in lackey
    mode then LUA would be a given, but if you normally run with
    UAC at the lowest setting then LUA is a confusing bug.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hank@21:1/5 to All on Wed Feb 5 15:47:50 2025
    Newyana2 wrote to us on Wed, 5 Feb 2025 08:45:30 -0500:

    UAC -- user account control -- can be changed
    in the user settings. But the lowest setting is still restricted.

    c:\windows\system32\runas.exe /user:administrator /savecred %cmd%

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JJ@21:1/5 to Marion on Thu Feb 6 05:09:22 2025
    XPost: alt.msdos.batch

    On Wed, 5 Feb 2025 10:49:24 -0000 (UTC), Marion wrote:

    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.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)