I always work on a normal account on my Windows box. Sometimes I need to install programs which requires administrator access. As I mostly use a Windows command prompt, is there any command similar to Linux' "sudo"?
|
feedback
|
|
The runas command.
Just run:
to start a command shell as a administrator | |||||||||||||||||
feedback
|
|
You can use the runas command which is kind of similar, or you can check out the sudo for Windows project over at SourceForge which adds a sudo command. The difference is subtle: Let's say you have two users. Bob is a normal user and James is an administrator. If you log in as Bob and use "runas james acommand" the command is run as if it was run by James, so it accesses James' user settings and any user changes go into James My Documents & settings folders, etc. So if you are installing an application, say, it will be installed as James, not as Bob. If on the other hand Bob does "sudo acommand" the command is still run as Bob, but with elevated permissions - just like the Linux sudo command. To prevent any user from being able to sudo you have to define a sudoers user group that contains the list of the normal users that have permission to elevate using sudo. The users still have to provide credentials before elevation. Sometimes the difference isn't important, sometimes it is, and I find that both commands can be useful. | |||||||
feedback
|
|
You can also use the Script Elevation PowerToys. | |||||||||
feedback
|
|
I discovered elevate today which "executes a command with UAC privilege elevation. This is useful for working inside command prompts or with batch files." It's not the same as
| |||||||
feedback
|
|
If you're doing this on Windows, then in addition to the Run As command as mentioned in a couple of other answers, there are also ways to do this with the mouse. If you hold down the Shift key as you right-click on most executable files in Windows you should notice a few more advanced options. One of these is the " You can also download a more advanced version of RunAs from Microsoft, called ShellRunAs, this has enhancements over the built-in RunAs command, both in command line and graphical modes, including letting you save account credentials | |||
|
feedback
|
|
Surun is free, open-source application that allows certain programs to run with administrative rights, without providing a password without changing the user registry or modify environment variables. When I was using Windows XP this app helps me a lot. Beta works under Windows 7. | |||
|
feedback
|
