Menu

Run as another user fails

2008-02-01
2012-11-13
  • Nobody/Anonymous

    I am an admin and have a lot of scripts to take care of. Some of my scripts needs to be edited using different permissions, thus I click edit from a separate window (where that window run as my admin-account). (Or I use a separate cmd-window)

    If I have a Notepad++ process already open (using my normal account), and then try to edit a document using notepad++, it detects and opens the file in the existing process, even though it should be created a NEW process using my other account! Often it then reacts with "cannot open file", since it lacks the admin-rights for opening the file.

    Can you please fix this behavior so it works like normal windows-programs (like notepad)?

     
    • Nobody/Anonymous

      Use the -multiInst commandline parameter to start a new instance of Notepad++

       
    • M. B. Huffman

      M. B. Huffman - 2008-02-01

      1. I keep a link to Notepad++ in the Quick Launch area. When I right-click the shortcut and select "Run as..." I can run NPP as a different user. This starts NPP in a new instance, even if another NPP instance is running under my normal account.

      2. I created a shortcut to NPP in my C:\bin directory which is in the PATH for all users named "nppu". For that shortcut properties I checked the box for "Run with different credential". From the Start->Run box I can enter nppu and a new instance of NPP will start (even if another normal user instance is open) after being prompted for user and password. I can also access the shortcut from a console window with the command "start nppu".

      3. Finally, I have a npp.bat file that simply calls NPP. If this batch file is called from an "admin console" (console opened with Administrator permissions) it also starts a new instance.

      I have not figured out a way to get a "different user" NPP set up in the Registry so that I can right-click and open a file from a current location. Method 3 is a reasonable solution, and actually the one I use the most.

      Not exactly what you asked for, but maybe some ideas for you to try.

      Mike