4

Almost all *.exe files I can right click -> Properties -> Compatibility -> Run as Admin.

But notepad.exe lacks the compatibility tab. Is there an alternative way that works even for notepad.exe?

Running Windows 10 Home, x64.

2

If you want to just launch Notepad.exe elevated on .txt files from a right click, how about adding the following keys:

[HKEY_CLASSES_ROOT\txtfile\shell\runas]
@="Notepad (admin)"
[HKEY_CLASSES_ROOT\txtfile\shell\runas\command]
@="notepad.exe \"%1\""

If there are other extensions you can add those as above.

4
  • What am I doing wrong? In HKEY_CLASSES_ROOT\.dat the (Default) has value dat_auto_file. In HKEY_CLASSES_ROOT\dat_auto_file i created runas key and in that I created command, but there is no context menu item when I right click a *.dat file?!?!?!
    – Coolwater
    Mar 19 '17 at 20:35
  • Does this example not work? pastebin.com/69VDSqVZ Mar 19 '17 at 20:47
  • I downloaded it and renamed the extention to .reg. Importing it returned the string "Keys succesfully added", and the keys are there as they should, but there is no item in the .dat context menu
    – Coolwater
    Mar 19 '17 at 21:10
  • Adding the keys to HKEY_CLASSES_ROOT\* works though, so I do that for now
    – Coolwater
    Mar 20 '17 at 9:49
6

This is because notepad.exe is located in C:\Windows\System32

In order to fix this, you have to copy notepad.exe to a different folder. From the new folder, you will find that the compatibility tab is there.

Don't forget to associate .txt files with that new notepad.exe. You can do this by holding shift, rightclick a text file, open with, choose another app, more apps, scroll down until the last item: choose another app from this pc, then browse to the new notepad.exe. Make sure you check "Always open with this app."

-4

Find notepad.exe in system32 folder, Properties/ Compatibility

enter image description here

4
  • 10
    Even your screenshot shows its greyed out and thus can't be edited. This is because its in the system32 folder. In windows 10, the tab is even hidden to make it less confusing. So -1 because in all efforts this does not help at all.
    – LPChip
    Mar 19 '17 at 12:15
  • Although the path is a bit off (C:\Users\%USERNAME%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Accessories) I checked and nope, no compatibility tab there either (which is logical because its just a shortcut to the .exe which resides in the system32 folder. Unless you screw with the permissions in the system32 folder, this is not gonna work.
    – LPChip
    Mar 19 '17 at 17:29
  • The path I wrote was not complete,you have in brackets -> for that user, and you get your address C:\Users\...And I didn't mention Compatibility tab, you go to Advanced button on the Shortcut tab and there you have Run as admin...It works for me, but you can't open files on double click, you have to browse with Open from Notepad...
    – dukasvili
    Mar 19 '17 at 18:53
  • So you're basically not answering the question but offering an alternative.
    – LPChip
    Mar 19 '17 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.