Windows – Open file with emacs as administrator on windows

emacswindows

Is it possible to open files as administrator from inside Emacs on windows?

In Linux one can use tramp to open as administrator, by opening file with following path (/sudo::/path/to/file)?

However, the same file path fails to work in Windows (naturally). How can one request an elevation of privileges for a single file during Emacs session then?

If possible, I would like to avoid launching Emacs as administrator.

Possibly one must do some setup in Windows for that – which, if any? Maybe something like privileged network access?..

Best Answer

I don't think there is a native way to do it, so I am relying on a 3rd-party tool: http://code.kliu.org/misc/elevate whenever i need to do this.

c:\elevate runemacs filename.txt

Enter your credentials in the UAC dialog box and your program will be run with administrative rights.

Related Question