Random Bits of Randomness

sudo4uac - Command line tool to elevate UAC

Warning: Geek Content:  I’m always tinkering on the command line in windows and inevitably wish I could run a command with elevated rights.  In Linux and Mac this is easy with the sudo command but whenever I type sudo at the windows command prompt, I imagine Bill Gates laughing a little.

I decided to write a simple little utility that will elevate commands at the Vista / Windows 7 command prompt much like sudo on Linux.

Download sudo4linux

After installing this file you will be able to run commands at the command prompt with “sudo” (or for those of you who can’t remember sudo, you can use “elevate”).  So for example, if you wanted to open notepad from the command prompt to edit your hosts file, you could do the following:

  sudo notepad c:\windows\system32\drivers\etc\hosts

or alternatively

  elevate notepad c:\windows\system32\drivers\etc\hosts

and obviously you could leave off the filename to just open notepad with elevated privledges:

  sudo notepad

you can also use sudo to open a new elevated command prompt by typing the following:

  sudo cmd

or use the shortcut command

  cmda

I hope this is as helpful for you as it is for me.

Filed under: apps geek
0 comments

Leave a comment...

To Posterous, Love Metalab