Wednesday, June 25, 2014

Notepad++ Save As Admin Plugin

I’ve used Notepad++ for a while now, but only recently started exploring all the various plugins that are available. One very helpful plugin is called “Save as Admin”, which can overcome a common issue when trying to edit files for which the local Users group does not have modify permissions. This often happens with web.config files, which by default live in a folder that only Administrators can modify. Even if you are a member of the Administrators group, you will still receive a “Save Failed” error message asking “Please check if this file is open in another program.” when you try and save any changes:

Please check if this file is opened in another program

If you check the permissions of the file, you will see the Users group only has read & execute, and does not have modify permission:


To fix this you have a few options:

  1. Close Notepad++ and re-open it as an administrator.
  2. Use the edit button on the security tab of the file properties to give the Users group or your individual user modify permissions.
  3. Save the file to another location like your desktop, and then copy from there into the destination folder. This will cause Explorer to display a “You must be an administrator to perform this action” window, but it will allow you to use your Administrator role to complete the action.
  4. Use the “Save as Admin” plugin in Notepad++ to elevate to the Administrator role and save the file.

If you have already made changes to the file and do not have the plugin installed, option 2 or 3 is the only way to keep those changes (the others require closing and reopening Notepad++). Once you install the “Save as Admin” plugin you can then use that to overcome any permissions issues.

To install the plugin open the Plugin Manager:


Type the letter S to find “Save as Admin” and check the box. You can install multiple plugins at once, and I recommend also adding “Compare”, “Reload"Button”, and “XML Tools”.

Save as admin plugin

Once you have selected the plugins you want press the Install button. It will download and install the plugins, most of which show up under the Plugins folder. When finished it will prompt you to restart Notepad++


NOTE: if you had pending changes to a file you may see the following:


There are actually two dialogs here, and the second one is hidden. You will need to click the grey bar behind the blue bar (or just click on Notepad++ in your task bar) to display the hidden window:


Here you should press no (loosing any changes) or yes and save to another location. Notepad++ should then restart. Now when you try to save a file that requires Administrator privileges you will get a UAC prompt:


Pressing Yes will allow Notepad++ to save the file using your administrator role.

No comments:

Post a Comment

Blog.TheG2.Net - Your guide to life in the Internet age.