Saturday, September 19, 2009

A few useful commands for Windows, restated.

It may come as a laughable surprise to those who are already familiar with these commands, but in some corners, pretty experienced workstation users haven't discovered them.

It was only after gaining some familiarity with using cygwin as a windows shell that we learned of some of these commands. Others are being restated because the make the list more useful as a quick console reference.

A quick listing of the options for most factory windows console commands is available using the command followed by /? which calls the help.

**** shutdown - works just like linux except that it doesn't.  shutdown can reboot, halt, hibernate, and sleep the machine.  We find this particularly useful when ssh'd into a windows machine.  One oddity is that be default windows will wait about thirty seconds to execute the shutdown. the /t notation sets the timeout.

shutdown /r /p restarts the computer immediately. Otherwise /t sets the timeout. /f forces everything to close immediatlely without saving.

shutdown /a aborts a shutdown while it's on a timer, as is the default.
details at shutdown /?

**** tasklist and taskkill - our new favorite friends.  It's roughly the equivalent of the ps and kill commands on linux. Tasklist lists the running processes with pids and taskkill can kill them, usually with less drama and clicking around than the explorer will allow.

taskkill /pid 0000 where the zeroes are pids garnered from tasklist to kill an errant process.  try /f to add more force. 

*** bcdedit is a command to to manipulate the windows bootloader. this one only works from cmd.exe, not from rxvt.  So far we've used it clear out excess entry caused by abruptly deleting and reclaiming dual boot partitions.  in particular, old xp installs and the remains of the chainloader left by wubi when the super easy ubuntu install is used.

I'm sure it is possible to foul up the boot process in ways that are very hard to recover from.  On the other hand there might be quite a few useful possibilities other than simply deleting stale entries. It's more useful than boot.ini.  boot.ini is gone now, for the rest of you out there that skipped vista entirely, like we did. bcdedit has also been used to do such things as disable driver checking in vista, and maybe 7. . . so the possibility exists that there are many useful boot time options that can be passed.  Should be a useful development to see some more options come to our attention.

Having mentioned them, Wubi installs are great for creating on a clean ubuntu install for testing something, As of this writing wubi exists for xubuntu, kubuntu, and mythbuntu as well.

There will be more of these commands posted here as we find them.

No comments:

Post a Comment