I haven't written anything in a while but there's this small thing bugging me right now and I cannot seem to find good answer using Google and browsing MSDN.
In UNIX family or alike OSes there's a command for lifting access rights for user which is called "su", like most of you probably know. There's also a command for running software with lifted privileges called "sudo".
I am pretty sure that UAC developers were not so stupid that they didn't include any CLI way to initiate UAC so that user can run software from command line with lifted rights.
So is there anything close to a su/sudo commands in Windows command line?
PS. Let me add that the point here isn't starting cmd.exe from start menu with "run as administrator" (after which you're running everything with lifted rights) but to run normal level cmd.exe and do something like "launch /uac application.exe" or "sudo application.exe". After that it will show secure desktop and asks for confirmation or asks the confirmation on command line itself.
I am asking this just out of curiosity because it would be great to have some way of running applications with lifted rights using keyboard only (I do know about ctrl+shift+return will launch cmd.exe in start menu with lifted privileges) for commands which will require administrative rights without running cmd.exe with lifted rights all the time.
Another easy thing to do (on Win7) is if you pin CMD.exe to the taskbar and then left click it, you get a low integrity cmd.exe. If you CTRL+SHIFT click it, it'll try and elevate and give you an Admin CMD.exe.
This "Elevate" program is pretty much what I was looking for. Thank you so much!
PS. runas.exe, as it seems to me, doesn't run things with elevated rights. Only as a different user with normal rights. If I do "runas /user:Administrator someapplication.exe" it runs it using Administrator account on normal user rights (after asking password).
If PowerShell is avalable you can use following comand:
powershell start-process -Verb "runas" cmd
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.