Sudo for Windows Vista
As a command line junkie, I end up doing almost everything from a command prompt. The problem is that Windows Vista doesn't have a built-in command to launch an application in administrator mode.
Thankfully Brandon Paddock has created an extremely useful tool called Start++ that has a built-in sudo command. If you're thinking it sounds familiar, it's because we've covered it before, but it's worth downloading for this one feature alone.
To launch a command in "sudo" mode from the start menu, just preface it with "sudo", which will launch the application in administrator mode.
It even works from the command line:


As a fellow geek … I have to applaud this! Excellent Find!!!!!!
"The problem is that Windows Vista doesn't have a built-in command to launch an application in administrator mode."
That's not correct. Forget sudo, just launch the App or cmd by pressing Alt+Enter.
Greeting,
Manuel Wenk
MCAD
I setup a shorcut to CMD.exe and then set the shortcut to have administrative privileges.
While Manuel Wenk is partially correct (you can use alt+enter only from start menu's launch), and hank has a good idea with creating a shortcut with admin privileges, but this tool would still be very handy for running programs from a networked drive with admin privileges–especially if you don't want to use start menu.
Sigh - I'm so frustrated that UAC and tools like this keep getting called sudo. A real sudo would allow the administrator to provide a list of applications that the user is allowed to run as an administrator. With UAC you have the admin group membership - we will just pretend that you don't unless you ask for them. A real sudo would be useful in cases where you don't want to give your users admin rights on their workstation but they have one application that will not work without admin rights. UAC is "lets give the user Admin rights whenever he asks for it and trust that he will never do anything wrong with it.
This is very useful. Alt+Enter is nice, but this is a lot more versatile, especially considering it works in the command prompt. Sure, I could just type "cmd" in the Start search box and press Alt+Enter, but what if I'm already in the command prompt and want to run bcdedit? I'd have to open a new command prompt with administrative privileges just to do that. This saves me time, even if it isn't a true sudo (and who even said it was?).
I wasn't saying it isn't useful - I am sure it is. But if someone calls something a duck then people expect it to quack. Now if it could run an application based on a rights to user table with a token that had the administrators group inserted without the use being an administrator then it could be called sudo and I would be pushing for a site license for the company I work at (so long as it passed a few security tests
. But I suspect there is no was MS would allow this to be done.
In a text file named sudo.bat, in your path…
runas /env /user:Administrator "cmd /c %*"
Works OK for me.
sudo notepad C:\windows\system32\driver\etc\HOSTS
I have an 'su.bat', too. Only difference is, it launches into a new cmd shell (which I colored red).
runas /env /user:Administrator cmd
You get a handy command prompt with 'Administrator' privileges where you don't have to 'elevate' individual commands. .