Quantcast
Channel: Planet Malaysia
Viewing all articles
Browse latest Browse all 15921

Raymond.CC: Trigger UAC Elevation from Command Line with Elevate Utility

$
0
0


Few days ago I was playing around with a rogueware and investigating the possibilities on what I can do when the EXE association has been modified or broken. As we all know, the EXE association plays a very important part in Windows operating system because most programs runs under a EXE file. Some examples are a .reg file requires regedit.exe, .msi file requires msiexec.exe, .vbs requires wscript.exe, .txt requires notepad.exe, and many more. So now you can imagine how bad the situation can get if the EXE extension is broken which prevents you from a lot of solution to fix the problem. Fortunately running any program from Windows Task Manager that is launched via Ctrl+Shift+Esc hotkey uses the default Windows EXE extension rather than the associated EXE extension in registry.

One limitation which I’ve discovered when a program ran from Windows Task Manager is its not necessarily elevated. Running regedit.exe is fine because every time you run regedit will prompt the UAC elevation window and clicking yes will give you full control over it. However try running the command prompt (cmd.exe) from there and it runs without an administrator privileges, limiting you from making any system changes.


For most programs, you can create a shortcut and then access the short’s properties by right clicking on the shortcut and select Properties. Go to Compatibility tab and check Run this program as an administrator. However this method is not possible for command prompt because all the check boxes and options in the Compatibility tab will be grayed out.

Compatibility modes cannot be set on this program because it is part of this version of Windows
Compatibility modes cannot be set on this program because it is part of this version of Windows

I could right click on the cmd.exe and select Run as Administrator but then the rogueware automatically terminates the command prompt upon running. So I am left with a final option to use a command line to trigger the UAC elevation on cmd.exe from Windows Task Manager > File > New Task (Run…). After looking around, I found two utilities that allows me do just that. Both programs are named Elevate, one is written by Kai Liu and the other by John Robbins. One example to use the elevate utility is to execute “elevate notepad” and you’ll be prompted with the UAC prompt to run notepad right from the command line.

In my case, I will execute elevate.exe cmd.exe at the Create New Task window from Windows Task Manager > File > New Task (Run…). I’ll be prompted with the UAC prompt and clicking Yes will run the command prompt as elevated.

Command Line UAC Elevation

The best part is any programs that I run FROM the elevated command line will be automatically elevated as well. For example, I will not be prompted the UAC window if I run regedit.exe from the elevated command prompt. The Elevate utility is definitely a very useful tool for power users.

Download Elevate by John Robbins OR Kai Liu

Trigger UAC Elevation from Command Line with Elevate Utility is a post from: Raymond.CC Blog


Viewing all articles
Browse latest Browse all 15921

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>