Elevated Privilege


  1. Posts : 25
    Windows 10 Pro version 20H2 (OS Build: 19042-985)
       #1

    Elevated Privilege


    All--

    It there a way to permanenly mark an executable (EXE, DLL, BAT, etc) to always run witth elevated privileges? My nightly file cleanup BAT launches BCDEdit (to reboot in Safe Mode) which requires elevated status.

    Thanks in advance for any help/direction,

    Randy Reist, Lairbear
      My Computer


  2. Posts : 16,974
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #2

    Create Elevated App Shortcut without UAC Prompt - TenForumsTutorials
    [Option 2 tells you what to do. Option 1 is a batch file that does it all for you.]

    In short, you tell Task scheduler to run the batch file elevated and you enter your password when you create the task so it is not needed when it runs.

    Then, if you want to launch the batch file manually as well as letting Task scheduler run it, all you need to do is create a shortcut that triggers the task - the shortcut does not generate any admin prompt.

    Denis
      My Computer


  3. Posts : 43,027
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #3

    Hi, are you using this in your BAT file?
    13 ways to use "Run as administrator" in Windows 10 | Digital Citizen
    - section 11

    And there's section 12..
      My Computers


  4. Posts : 7,607
    Windows 10 Home 20H2
       #4

    Try3 said:
    enter your password when you create the task
    Option 1 will not ask you to enter your password. Option 1 has been updated. Have you tried it?
      My Computer


  5. Posts : 25
    Windows 10 Pro version 20H2 (OS Build: 19042-985)
    Thread Starter
       #5

    dalchina--

    Firstly, thanks for the expeditious reply.

    Unfortunately, the pulldown from Properties does NOT provide a Compatability tab for BAT file, only EXEs, etc.

    In my opinion, Microsoft has made "A sows ear out of a silk purse" security-wise, in the broadest sense! The whole thing is over-designed. They could have provided the same level of security (and more) with a simpler design.

    Randy
    40-year Software Engineer, Ret. (design/support)

    - - - Updated - - -

    All--

    Admittedly, I failed to consider checkin the Run with higherst privileges box in Task Scheduler. I have now done so...I suspect that things will run differently in tonite's BAT run.

    I'm closing this thread.

    Thanks for brining my oversight to my attention.

    Randy
      My Computer


  6. Posts : 16,974
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #6

    Matthew Wai said:
    Option 1 will not ask you to enter your password. Option 1 has been updated. Have you tried it?
    No, I use Option 2.

    Denis
      My Computer


 

  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 07:23.
Find Us




Windows 10 Forums