Community
    • Login

    Run As Administrator.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 525 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Сергей ДрузьС
      Сергей Друзь
      last edited by

      Hi! ✌️

      How do I run a specific file as an administrator?
      For example TEST.txt

      1 Reply Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse
        last edited by

        What exactly do you mean by run a file?
        Executing?
        Opening/Reading?
        Saving/Writing?

        When doing one of the above mentioned actions, the process needs to
        have the proper rights to do so. In case of executing and saving there
        are workarounds to have an unprivileged process doing this by using
        tools like runas and plugins like SaveAsAdmin, which themself
        will spawn a new process with the proper rights.

        When trying to open a file for reading it isn’t that easy, afaik.
        You can start npp with an administrative account but this means
        all of your files opened/saved do get treated with the privilege.

        1 Reply Last reply Reply Quote 2
        • Сергей ДрузьС
          Сергей Друзь
          last edited by

          @Ekopalypse said in Run As Administrator.:

          I have a file called “RunScript_Notepad++.ahk”.

          I added the script to the menu > Run > Run… F5
          But it works only if I go - NotePad++.exe > Right-click > Properties > Compatibility > Run this program as administrator

          How do I set up the administrator rights only for this file❓

          1 Reply Last reply Reply Quote 0
          • EkopalypseE
            Ekopalypse
            last edited by

            You would, for example, use runas.

            In run menu, you would call cmd /k runas /user:YOUR_NAME@YOUR_HOST PROGRAM_TO_EXECUTE

            Once everything works as expected, you can substitute /k with /c and
            the cmd shell gets closed automatically.

            1 Reply Last reply Reply Quote 2
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors