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

    From Marion@marion@facts.com to alt.comp.os.windows-10,alt.msdos.batch on Wed Feb 5 10:49:24 2025
    From Newsgroup: 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: ?
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From JJ@jj4public@outlook.com to alt.comp.os.windows-10,alt.msdos.batch on Thu Feb 6 05:09:22 2025
    From Newsgroup: 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.
    --- Synchronet 3.21d-Linux NewsLink 1.2