Thursday, January 28, 2021

Opening Files as Administrator in Notepad

The Problem

 So you merrily double click a text file in Explorer and make sure heart-felt changes and then hit CTRL+S. Done. Maybe not. Instead, Notepad prompts for a new file, asks you to save it in Documents, or just denies the request altogether.



Windows, why, dost thou torture me?

Well, we know Windows does a good job these days of protecting us from such vile predators as ourselves but it can be frustrating. That said, we owe a lot to the annoying, but protective, User Account Control. 

A Quick Solution

You may have already tried creating a shortcut to notepad that has "Run as Administrator" enabled. This does allow you to drag files from Explorer onto this shortcut to launch Notepad as admin. This is an okay solution but my monitor is 43" and dragging is an inexact science that is prone to mishap.

My Preferred Solution: Send to > Notepad as Admin

You remember Send To, right? That handy, dandy context submenu allowing to send a file to a zip, e-mail destination, or even fax? But how do I set that up? Well, it just so happens I had to implement send to fax back in the "aughts" and implementing items in Send To is a well thought out breeze in my opinion.

Step 1: Notepad shortcut

We'll need that shortcut you probably already created to run Notepad as admin. Haven't done it yet? Alright. We can cover that. There are many ways to get that shortcut. Perhaps the easiest is to:
  1. Go to the Windows menu.
  2. Type notepad.
  3. Right click Notepad in the search results.
  4. Select Open file location.
  5. Copy the Notepad shortcut to your desktop (careful not to move it).


Step 2: Change the shortcut to Run as admin

If you don't know how to do this yet, here's a way:
  1. Right click the Notepad shortcut.
  2. Select Properties from the menu.
  3. On the Shortcut tab, choose the button labelled Advanced....
  4. On the Advanced Properties dialog, check Run as administrator.

Step 3: Copy the shortcut to the Send to folder

There's a Send to folder? Yes, there is. Don't know how to get there? It's pretty easy these days:
  1. Go to the Run prompt  (Windows Key + R).
  2. Type shell:sendto
  3. Now move or copy your shortcut from the desktop to the Send To folder.

Step 4: (Optional) Rename your shortcut

I didn't think Send to > Notepad was enough information, so I renamed my shortcut to Notepad as Admin.

Try it out: Right click a file, choose Send To, and then your shortcut.




No comments:

Post a Comment