UAC prompt - .bat


  1. Posts : 2
    Win10
       #1

    UAC prompt - .bat


    Windowsversion: 1903

    Hey guys

    I have been trying to find a topic that explained exactly what I needed.
    Think is, I have a file that I would like to run, but don't want to type in my administrator each time.

    I'd like right click on the file, and then be able to click on a line under Run as administrator.
    I used to work in a company where the domain management department made Regedit files that would do this.
    However as I never asked questions to how they set it up, then I now have an issue as I want to set it up, but don't know how to do it.

    So...

    I'd like to be able to right click a .bat file and then have the user run it without administrator rights.
    I don't want this user to have any administrator rights what so ever, nor do I want my password to be entered anywhere.

    From my memory, it looks something like this picture I made...

    Hope you can help.


    Best regards
    KasperHV
    Attached Thumbnails Attached Thumbnails UAC prompt - .bat-run-without-administrator-rights.png  
      My Computer

  2. Brink's Avatar
    Posts : 56,452
    64-bit Windows 10 Pro for Workstations build 21364
       #2

    Hello Kasper, and welcome to Ten Forums.

    You might see if using option 1 in the tutorial below may work for this for you. It uses a 3rd party program RunasSPC to allow the standard user run it as administrator without your password being exposed to them.

    Elevated Program Shortcut - Create for Standard User - Windows 7 Help Forums
      My Computers


  3. Posts : 2
    Win10
    Thread Starter
       #3

    Hey Brink

    Alright, so I got this file from an old colleague.
    And the contant is this..

    [HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker]
    @="Run without admin rights (UAC)"

    [HKEY_CLASSES_ROOT\*\shell\forcerunasinvoker\command]
    @="cmd /min /C "set __COMPAT_LAYER=RUNASINVOKER && start "" "%1"""


    However when I Merge it, then it comes up with an error.

    Do you happen to know what I'm doing wrong?
      My Computer

  4. Brink's Avatar
    Posts : 56,452
    64-bit Windows 10 Pro for Workstations build 21364
       #4

    What's the error message?
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 17:38.
Find Us




Windows 10 Forums