It is becoming increasingly common to receive an Access is Denied error when trying to save a file in notepad. There are a few ways of getting around this.
- Open notepad as administrator
- File -> Open
- Navigate to the file you want to open
- Use Notepad++
Although I do use Notepad++, sometimes I just want a right-click context menu to open notepad as an administrator.
If you trust me, you can download the registry file from here and skip to step 4. You may have to use right-click -> save file.
1. Create a new text file on your desktop.
2. Paste the following into it.
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\txtfile\shell\runas\command] @="NOTEPAD.EXE %1"
3. Save the file as NotepadAsAdmin.reg. Remember to change the Save as type to All Files.
4. Double click the reg file to run it.
5. Test by locating a text file and right clicking it.
You can now right click any *.txt file and select Run as administrator.
How does it work?
This method works by giving the .txt extension a runas command in the registry. We simply point that command to notepad.exe.