one of the stupid things to love about unix is the superuser command, or su which lets you become root right there on the command line, which has an incredible number of uses that i won't go into here. since windows 2000, NT has had a similar but still inferrior command known as runas. if you are like me, and are constantly confusing unix and NT commands, here is a handy tip: write a shell script (in dos they are called batch files) to become root (administrator) just like on a unix system. this is really simple, and just like with su for unix, you will have to know the root (administrator) password in order to actually become root.
- first, from a shell prompt, navigate to a folder on your path, like windows, winnt, or winnt\system, etc.
- then, use notepad to create a file called su.bat like so:
- type the following, where machinename is your local machine name:
runas /profile /user:machinename\administrator cmd
- save the changes and exit notepad.
- finally, from the command prompt type
su and you should be prompted for the local administrator password. enter it, and another shell should pop up. in the title bar it should say "running as machinename\administrator. any commands to execute here will run as if you were logged in as the local administrator.
this is a handy little fix i make for all my windows machines, which saves me from logging out all the time, and means that i don't have to run as a local administrator in my day to day tasks.
you can run any windows command this way, including mmc, and my computer. to start my somputer from the command line, type:
start path where path is some place on the filesystem (like c:\some\place\on\the\filesystem)