stuff to click

read news
linux & me
* shell scripting *
unix shells
what is kill-9?
got geek?
hi morgen!

tools used

proud to be WYSIWYG free!

Chris's lack of artistic ability has been cleverly disguised by the GIMP


Apache, jump on it!

Powered by openBSD

su.bat: the super user command for win2k/XP

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.

  1. first, from a shell prompt, navigate to a folder on your path, like windows, winnt, or winnt\system, etc.
  2. then, use notepad to create a file called su.bat like so:
    notepad su.bat
  3. type the following, where machinename is your local machine name:
    runas /profile /user:machinename\administrator cmd
  4. save the changes and exit notepad.
  5. 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)

webbak, my first shell script
webbak 2, the sequel
getnews, your news authority
su.bat, superuser for NT
sed tutorial, very informative
    home     blog     read news     linux & me     * shell scripting *     unix shells   what is kill-9?     BOFH     got geek?     l33t