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

Blacksmith

New member
Local time
6:20 PM
Messages
14
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 My Computer

At a glance

Windows 7 Ultimate x64Phenom II X6 10904x2G Kingston HyperX DDR3 1366 (7-7-7-20)ASUS NVIDIA GeForce 9600GT
OS
Windows 7 Ultimate x64
CPU
Phenom II X6 1090
Motherboard
ASUS CROSSHAIR IV Formula
Memory
4x2G Kingston HyperX DDR3 1366 (7-7-7-20)
Graphics Card(s)
ASUS NVIDIA GeForce 9600GT
Monitor(s) Displays
2xSyncMaster 245e 1920x1280
Hard Drives
6x Samsung 1GB HD103SJ
PSU
Enermax Modu87+ 700W
Case
Zahlman GS100Plus
Cooling
Scythe Kabuto

My Computer My Computer

At a glance

64-bit Windows 11 Pro for WorkstationsIntel i7-8700K OC'd to 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
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 My Computer

At a glance

Windows 7 Ultimate x64Phenom II X6 10904x2G Kingston HyperX DDR3 1366 (7-7-7-20)ASUS NVIDIA GeForce 9600GT
OS
Windows 7 Ultimate x64
CPU
Phenom II X6 1090
Motherboard
ASUS CROSSHAIR IV Formula
Memory
4x2G Kingston HyperX DDR3 1366 (7-7-7-20)
Graphics Card(s)
ASUS NVIDIA GeForce 9600GT
Monitor(s) Displays
2xSyncMaster 245e 1920x1280
Hard Drives
6x Samsung 1GB HD103SJ
PSU
Enermax Modu87+ 700W
Case
Zahlman GS100Plus
Cooling
Scythe Kabuto
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 My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
...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 My Computer

At a glance

W7 Pro SP1 64biti78GBIntel HD Graphics
Computer type
Laptop
Computer Manufacturer/Model Number
Employer provided Dell Latitude
OS
W7 Pro SP1 64bit
CPU
i7
Memory
8GB
Graphics Card(s)
Intel HD Graphics
Hard Drives
crappy SSD
Antivirus
Employer mandated Symantec Endpoint Protection
Browser
Pale Moon 64bit, IE11 64bit & Chrome 64bit
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 My Computer

At a glance

64-bit Windows 11 Pro for WorkstationsIntel i7-8700K OC'd to 5 GHz64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600...ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Self built custom
OS
64-bit Windows 11 Pro for Workstations
CPU
Intel i7-8700K OC'd to 5 GHz
Motherboard
ASUS ROG Maximus XI Formula Z390
Memory
64 GB (4x16GB) G.SKILL TridentZ RGB DDR4 3600 MHz
Graphics Card(s)
ASUS ROG-STRIX-GTX1080TI-O11G-GAMING
Sound Card
Integrated
Monitor(s) Displays
2 x Samsung Odyssey G7 27"
Screen Resolution
2560x1440
Hard Drives
1TB Samsung 990 PRO M.2,
4TB Samsung 990 PRO PRO M.2,
TerraMaster F8 SSD Plus NAS
PSU
Seasonic Prime Titanium 850W
Case
Thermaltake Core P3
Cooling
Corsair Hydro H115i
Keyboard
Logitech wireless K800
Mouse
Logitech MX Master 4
Internet Speed
2 Gb/s Download and 100 Mb/s Upload
Antivirus
Malwarebyte Anti-Malware Premium
Browser
Google Chrome
Other Info
Logitech Z625 speaker system,
Logitech BRIO 4K Pro webcam,
HP Color LaserJet Pro MFP M477fdn,
APC SMART-UPS RT 1000 XL - SURT1000XLI,
Galaxy S23 Plus phone
Back
Top