Code Play a software blog by tim benke

command-line in Windows

I personally prefer the bash even in cygwin over the dos shell many times, but it’s often the only shell available and has more features on windows.

An example would be of course system administration stuff, like starting services – the windows equivalent of UNIX daemons: net start/stop *service-name* or killing processes by pid: taskkill /pid 1234 by name: taskkill /IF "abc.exe" or by window title – thanks to windows hard coupling of GUI and OS: taskkill /IM * /FI "WindowTitle eq *window title wo quotes*" shutting down (See this blog entry): shutdown -s In conjunction with killing processes by WindowTitle it’s nice to know how to set the title of the command prompt: title *title* Some commands are especially useful if you have to automatically setup a system. Change the hostname: wmic computersystem where name="%COMPUTERNAME%" call rename name="NEW" reset windows vista/7 activation grace period to 30 days (can be done up to 3 times): slmgr.vbs /rearm enter windows 7 product key slmgr.vbs /ipk start windows 7 online activation slmgr.vbs /ato Generally useful stuff in the dos shell: chaining commands: echo 1 && echo b