Members of this site know of my deep esteem for Nir Sofer and his unending output of portable, incredibly beneficial...
utilities for Windows. NirCMD, now in its 2.0 iteration, is a command-line version of a Swiss army knife, providing dozens of commands that you can incorporate into scripts or simply invoke by hand from the command line.
Many of the commands are things you might have available in other quick-and-dirty command-line utilities, but NirCmd lets you replace many of them in one package.
NirCmd's syntax is simple enough—nircmd, followed by a number of arguments that describe what to do and how to do it. For instance, nircmd standby puts the system into standby mode; nircmd win min class "IEFrame" minimizes all Internet Explorer windows.
The exact syntax for each command is spelled out in detail in the documentation. (Note: If you get into the habit of using NirCmd from the command line for many things, you can always rename it something shorter like ni to save yourself that many more keystrokes.)
Here's a sampling of the commands available within NirCMD:
- Shut down, reboot, log off, or put the system into standby mode.
- Open and close CD/DVD-ROM drives.
- Change or mute the system volume.
- Change attributes for a program window, including its size, position, Z-order or transparency.
- Kill a process.
- Perform manipulations with the clipboard, including reading or writing the contents of a text file to or from the clipboard.
- Dump the memory of an active process to a text file.
- Adjust display settings.
- Change the time/date stamp for files or folders.
- Run other applications with special attributes (such as specifying which folder to run in).
- Create shortcuts to applications.
- Add, remove or change Registry settings.
- Send mouse or keyboard events to the system.
- Open dialog boxes to get user feedback.
- Perform any of the above actions after an arbitrary pause, or simply pause.
- Perform any of the above actions on another computer across the network.
The 2.0 version insures that many of the commands, including audio controls, work properly in Windows Vista, and includes many new functions (such as the dialog-box commands).
About the author: Serdar Yegulalp is editor of the Windows Insight, (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of Windows experience under his belt, and contributes regularly to SearchWinComputing.com and SearchSQLServer.com.
More information on this topic:
- Tip: Top ten Windows Server 2003 command-line functions
- Topics: Windows scripting
- RSS: Sign up for our RSS feed to receive expert advice every day.