How to associate Edit for .BAT to open always with 'Run as Admin' rigt


  1. Posts : 14
    Windows 7 Ultimate x64
       #1

    How to associate Edit for .BAT to open always with 'Run as Admin' rigt


    I'm looking for a way to force 'Edit' in the Explorer context menu for .BAT files to always start my EdiPadPro.exe (just a programers editor) with 'Run as Admin' rights.

    The best way I know up to now is creating a Shortcut and to add it to 'Send To'. This shortcut can be forced to start my editor with privileges.

    I tried to make a file association to the shortcut, but windows is to clever and binds the .BAT extension directly to the .EXE. And I see no way to force a .EXE to execute only with 'Run as Admin' rights. This way I would be able to save the .BAT after having it edited.

    I do understand, that I need to confirm during program start by means of the dialog box.


    Any clever ideas?
      My Computer


  2. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
       #2

    Hello Blacksmith,

    If you like, you should be able to use OPTION FIVE in the tutorial below with the EdiPadPro.exe file to check the Run this program as an administrator box for this.

    Run as Administrator

    Hope this helps, :)
    Shawn
      My Computer


  3. Posts : 14
    Windows 7 Ultimate x64
    Thread Starter
       #3

    Hi Shawn

    Thank you for your answer. Tutorial OPTION 5 helped me to run the Editor in Admin-Mode. And no - it did not help, saving to \Windows\Bat. It seems writing to this location is protected by some other mechanism, that stops programs from writing to this location regardless whether they runs with Admin rights.

    Your post made me realize, that there are two 'Run as Administrator' checkboxes for shortcuts. I always used (Properties --> Shortcut --> Advanced). Is there any recommended reading to understanding the differences between the checkboxes for 'Run as Administrator' in
    - 'Properties --> Shortcut --> Advanced'
    and
    - 'Properties --> Compatibility'
    ?

    Walter
      My Computer


  4. Posts : 10,485
    W7 Pro SP1 64bit
       #4

    Let's say that you have two shortcuts to start notepad:

    For shortcut #1, you set the run as admin via
    'Properties --> Shortcut --> Advanced'

    For shortcut #2, you do nothing special.

    Shortcut #1 will run notepad as admin.

    Shortcut #2 will not.


    =============


    Now change shortcut #1 to run notepad as admin via
    'Properties --> Compatibility'

    For shortcut #2, you do nothing special.

    Shortcut #1 will run notepad as admin.

    Shortcut #2 will also run notepad as admin because notepad has been added to a list of apps in the registry and it does not matter how you start notepad from then on - it will run as admin.

    That said, notepad is a bad example since...
    'Properties --> Compatibility'
    ...is greyed out.
      My Computer


  5. Posts : 10,485
    W7 Pro SP1 64bit
       #5

    Blacksmith said:
    ...it did not help, saving to \Windows\Bat. It seems writing to this location is protected by some other mechanism, that stops programs from writing to this location regardless whether they runs with Admin rights....
    I can write to that folder using W7's native notepad if notepad is running as admin.
      My Computer


  6. Posts : 71,977
    64-bit Windows 11 Pro for Workstations
       #6

    Walter,

    If it doesn't have to be at C:\Windows\Bat, then you might test to see how it works to save to one of the C:\Users\Public folders instead since you should have full access rights to that location.
      My Computer


 

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

© Designer Media Ltd
All times are GMT -5. The time now is 01:34.
Find Us