In Windows Vista, Microsoft added UAC (User Account Control), which prevents privilege escalation for running apps and requires explicit user confirmation in case the application needs to perform an elevated task. Some console commands also require elevation. So, if you accidentally type such a command in the regular command prompt window, it will fail. You need to open yet another, elevated command prompt instance. Most people don't know how to open an administrator command prompt and it is not easy for them.
You can open an elevated command window using one of the methods mentioned here: Do you know all these ways to open an elevated command prompt in Windows?. The problem is even after opening it, you often need to change the current path to the required directory. This is because, by default, Windows opens the elevated command prompt at C:\Windows\System32. Command Prompt does not provide any built-in feature to open its elevated instance at the same path.
To solve this issue, you can use ELE.exe - a tiny console application I coded to open a new console window at the current directory from the existing command prompt window.
The usage of ELE is very simple.
ele /x - opens a new console window in the current directory and closes the original console window. If ELE is started from a file manager, it automatically opens a new elevated console at the current path.
Put ele.exe in any folder which is included in your system %PATH% environment variable, e.g. C:\Windows. That will make it accessible from any folder and you will not need to type the full path to ele.exe every time you want to elevate the command prompt.
You can download ELE here:
This is not the only way to can use ELE. It can be integrated into your favorite file manager, like File Explorer, FAR Manager or Total Commander. Here are a few examples below.
Open an elevated command prompt from File Explorer
If you copy ELE.exe to any directory in your system path such as C:\Windows, then you can simply press Alt+D while you are working in any folder to take the focus to the address bar, and type there: ele and press Enter. An elevated command prompt will open at the path you are in. This is a fast method using the keyboard.
It is also possible to integrate ELE with the File Explorer app. Once this is done, you will be able to open an elevated command prompt from the context menu directly.
To get it working, just merge the following Registry tweak:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\Background\shell\ele\command] @="ele.exe" [HKEY_CLASSES_ROOT\LibraryFolder\background\shell] [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\ele] [HKEY_CLASSES_ROOT\LibraryFolder\background\shell\ele\command] @="ele.exe" [HKEY_CLASSES_ROOT\Directory\shell\ele\command] @="cmd /c cd /d \"%1\" & ele /x"
The result will be as follows:
Open an elevated command prompt from Total Commander
That is required so ELE opens an elevated command prompt window using the directory opened in the active panel of Total Commander.
Open an elevated command prompt from FAR
FAR Manager, the open source console file manager which was very popular some time ago, has a nice feature called "User Menu". It is a special menu which appears when you press the F2 key. The user can add his own commands to that menu, so ELE can be added there.
Press F2, then press INS. Type ele.exe in the command box and you are done:
ele application.exe [arguments]
For example, the following command will open Notepad elevated with the file specified after it:
ele notepad.exe d:\text1.txt
That's it. If you found anything to say about ELE, report a bug or make a suggestion, you are welcome to comment.
Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:
If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!