JSI Tip 8586. NirCMD is a freeware command-line utility that can write and delete values and keys in the Registry, write values into INI file, dial to your internet account or connect to a VPN network, restart windows or shut down the computer, create sho

Jerold Schulman

October 18, 2004

4 Min Read
ITPro Today logo in a gray background | ITPro Today

Download nircmd.zip.

The help file begins with:

NirCmd v1.52Copyright (c) 2003 - 2004 Nir Sofer

Description

NirCmd is a small command-line utility that allows you to do some useful tasks withoutdisplaying any user interface. By running NirCmd with simple command-line option, you canwrite and delete values and keys in the Registry, write values into INI file, dial to yourinternet account or connect to a VPN network, restart windows or shut down the computer, create shortcut to a file, change the created/modified date of a file, change your displaysettings, turn off your monitor, open the door of your CD-ROM drive, mute or adjust sound volume, and more...

Examples of what you can do with NirCmd

Open the door of J: CD-ROM drive

nircmd.exe cdrom open j:

Close the door of Y: CD-ROM drive

nircmd.exe cdrom close y:

Increase the system volume by 2000 units (out of 65535)

nircmd.exe changesysvolume 2000

Decrease the system volume by 5000 units (out of 65535)

nircmd.exe changesysvolume -5000

Set the volume to the highest value

nircmd.exe setsysvolume 65535

Mute the system volume

nircmd.exe mutesysvolume 1

Unmute the system volume

nircmd.exe mutesysvolume 0

Switch the system volume between the mute and normal state.

nircmd.exe mutesysvolume 2

Create a shortcut on your desktop that switch the system volume between the mute and normal state.

nircmd.exe cmdshortcut "~$folder.desktop$" "Switch Volume" mutesysvolume 2

Turn off the monitor

nircmd.exe monitor off

Start the default screen saver

nircmd.exe screensaver

Put your computer in 'standby' mode

nircmd.exe standby

log off the current user

nircmd.exe exitwin logoff

Ask if you want to reboot, and if you answer 'Yes', reboot the computer.

nircmd.exe qboxcom "Do you want to reboot ?" "question" exitwin reboot

Turn off your computer

nircmd.exe exitwin poweroff

Turn off all computers specified in computers.txt !

multiremote copy "c:tempcomputers.txt" exitwin poweroff force

Dial to "My Internet" connection

nircmd.exe rasdial "My Internet"

Disconnect the "My Internet" connection

nircmd.exe rashangup "My Internet"

Make your Internet Explorer windows 75% transparent ! (192 / 256)

nircmd.exe win trans ititle "internet explorer" 192

Minimize all your Internet Explorer windows

nircmd.exe win min class "IEFrame"

Close all your Internet Explorer windows

nircmd.exe win close class "IEFrame"

Close all your Explorer windows (My Computer, folders, and so on)

nircmd.exe win close class "CabinetWClass"

Hide all your Internet Explorer windows

nircmd.exe win hide class "IEFrame"

Show all your Internet Explorer windows (after you made them hidden with previous example)

nircmd.exe win show class "IEFrame"

Create a shortcut on your desktop that closes all your Internet Explorer windows

nircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class "IEFrame"

Create a shortcut on your desktop that hides all your Internet Explorer windows

nircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class "IEFrame"

Create a shortcut on your desktop that shows back all your Internet Explorer windows

nircmd.exe cmdshortcut " "~$folder.desktop$ "Show All IE" win show class "IEFrame"

Set the Windows Calculator as top-most window (above all other windows)

nircmd.exe win settopmost title "Calculator" 1

Set the Windows Calculator back to regular window (non top-most window)

nircmd.exe win settopmost title "Calculator" 0

Create a shortcut to Windows calculator under Start Menu->Programs->Calculators

nircmd.exe shortcut "f:winntsystem32calc.exe" "~$folder.programs$Calculators" "Windows Calculator"

Create a shortcut on your desktop that opens the door of K: CDROM drive when you run it.

nircmd.exe cmdshortcut "~$folder.desktop$" "Open CDROM" cdrom open k:

Create a shortcut to NirSoft Web site on your desktop

nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.desktop$" "NirSoft"

Add NirSoft Web site to your Favorities under Links folder.

nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.favorites$Links" "NirSoft"

Create a shortcut to NirSoft Web site on the desktop of all computers listed in computers.txt

nircmd.exe multiremote copy "c:tempcomputers.txt" urlshortcut "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft"

Set the display mode to 800x600x24bit colors

nircmd.exe setdisplay 800 600 24

Create a shortcut on the desktop that set the display mode to 800x600x24bit colors

nircmd.exe cmdshortcut "~$folder.desktop$" "800x600x24" setdisplay 800 600 24

Copy all shortcuts on your desktop to another folder (f:tempdesktop).

nircmd.exe execmd copy "~$folder.desktop$*.lnk" f:tempdesktop

Restart your Apache server (under Windows NT/2000/XP/2003)

nircmd.exe service restart apache

Create a shortcut on your desktop that restarts the Apache server

nircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service restart apache

Restart your IIS

nircmd.exe service restart w3svc

Restart MySql

nircmd.exe service restart MySql

NOTE: THe help file contains much more.



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like