NirCmd - Windows Command Line Tool
NirCmd - Windows Command Line Tool
NirCmd - Windows Command Line Tool
NirCmd v2.86
Blog
Copyright (c) 2003 - 2019 Nir Sofer
Search
FAQ
See Also
TOP 10
Pad Files SoundVolumeView - Display, change, mute, unmute the volume level of sound components on
Contact Windows 10/7/8/2008 from command line or GUI .
About... NK2Edit - Edit, merge and fix the AutoComplete files (.NK2) of Microsoft Outlook.
Donate
Description
All Utilities
Password Tools
NirCmd is a small command-line utility that allows you to do some useful tasks without displaying
System Tools any user interface. By running NirCmd with simple command-line option, you can write and delete
Browser Tools values and keys in the Registry, write values into INI file, dial to your internet account or connect to a
Programmer Tools VPN network, restart windows or shut down the computer, create shortcut to a file, change the
created/modified date of a file, change your display settings, turn off your monitor, open the door of
Network Tools
your CD-ROM drive, and more...
Outlook/Office
64-bit Download Examples of what you can do with NirCmd
Panel
Forensics
Open the door of J: nircmd.exe cdrom open j:
Pre-Release Tools CD-ROM drive
Articles
Close the door of Y: nircmd.exe cdrom close y:
CD-ROM drive
Speaks the text
currently in the
clipboard (For speak text ~$clipboard$
Windows
XP/Vista/7/8).
Speaks the text
stored inside
speak.txt into speak file "c:\temp\speak.txt" 0 100 "c:\temp\speak.wav" 48kHz16BitStereo
speak.wav filename
(For Windows
XP/Vista/7/8).
Remove the title bar nircmd.exe win -style title "my computer" 0x00C00000
of My Computer
window.
Return the title bar
of My Computer
window that we nircmd.exe win +style title "my computer" 0x00C00000
removed in the
previous example.
Set the My
Computer window
to right-to-left order nircmd win +exstyle title "my computer" 0x00400000
(For hebrew and
arabic languages)
Set all child
windows of My
Computer window nircmd win child title "my computer" +exstyle all 0x00400000
to right-to-left order
(For hebrew and
arabic languages)
Create a shortcut on
your desktop that
nircmd.exe cmdshortcut " "~$folder.desktop$ "Close All IE" win close class
closes all your "IEFrame"
Internet Explorer
windows
Create a shortcut on
your desktop that
nircmd.exe cmdshortcut " "~$folder.desktop$ "Hide All IE" win hide class
hides all your "IEFrame"
Internet Explorer
windows
Create a shortcut on
your desktop that
nircmd.exe cmdshortcut " "~$folder.desktop$ "Show All IE" win show class
shows back all your "IEFrame"
Internet Explorer
windows
Create a shortcut to
Windows calculator
nircmd.exe shortcut "f:\winnt\system32\calc.exe"
under Start Menu- "~$folder.programs$\Calculators" "Windows Calculator"
>Programs-
>Calculators
Hide the start button nircmd.exe win child class "Shell_TrayWnd" hide class "button"
on the system tray
Show the start nircmd.exe win child class "Shell_TrayWnd" show class "button"
button on the system
tray
Hide the clock on nircmd.exe win child class "Shell_TrayWnd" hide class "TrayClockWClass"
the system tray
Show the clock on nircmd.exe win child class "Shell_TrayWnd" show class "TrayClockWClass"
the system tray
Kill (terminate) all
instance of Internet nircmd.exe killprocess iexplore.exe
Explorer processes
Create a shortcut on
your desktop that
opens the door of K: nircmd.exe cmdshortcut "~$folder.desktop$" "Open CDROM" cdrom open k:
CDROM drive when
you run it.
Create a shortcut to
NirSoft Web site on nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.desktop$" "NirSoft"
your desktop
Add NirSoft Web
site to your nircmd.exe urlshortcut "http://www.nirsoft.net" "~$folder.favorites$\Links"
Favorities under "NirSoft"
Links folder.
Create a shortcut to
NirSoft Web site on
nircmd.exe multiremote copy "c:\temp\computers.txt" urlshortcut
the desktop of all "http://www.nirsoft.net" "~$folder.common_desktop$" "NirSoft"
computers listed in
computers.txt
Create a shortcut on
the desktop that set
nircmd.exe cmdshortcut "~$folder.desktop$" "800x600x24" setdisplay 800
the display mode to 600 24
800x600x24bit
colors
Create a shortcut on
your desktop that nircmd.exe cmdshortcut "~$folder.desktop$" "Restart Apache" service
restarts the Apache restart apache
server
Restart your IIS nircmd.exe service restart w3svc
Answer 'Yes' to a
standard Windows nircmd.exe dlg "" "" click yes
message-box.
System Requirements
This utility can work in all versions of Windows operating system: Windows 9x/ME, Windows NT,
Windows 2000, Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008,
Windows 7, Windows 8, and Windows 10.
Versions History
Fixed bug: NirCmd failed to execute the cmdwait, loop and a few
23/05/2016 2.81 other commands after qboxcom and qboxcomtop commands.
Fixed bug: clipboard readfile failed to read the last character of Ascii
file.
Added writeufile and addufile to clipboard command, for writing
30/01/2016 2.80
files in Unicode.
Fixed the restartexplorer command to work properly on Windows 10.
29/10/2012 2.71 Added runassystem command, which allows you to run a process
with SYSTEM user (Works on Windows 7/8/Vista/2008)
Added new option to speak command: You can now save the entire
speach into a .wav file that can be played with any media player
(Instead of playing it directly to your sound card).
Added restartexplorer command, which simply restarts Windows
Explorer gracefully.
Added screensavertimeout command, which allows you to set the
screensaver timeout, in seconds.
12/09/2012 2.70 Added togglemax, togglemin, togglehide, toggledisable actions to
win command.
Added SystemSounds support for setappvolume, changeappvolume,
and muteappvolume commands.
Fixed issue on Windows 7: 'win close alltopnodesktop' command
caused a shutdown dialog-box to appear.
Fixed the setprimarydisplay to work properly.
Added mediaplay command for playing audio file (.mp3, .wav, and
so on) for the specified number of milliseconds.
21/06/2011 2.60 Added changebrightness and setbrightness commands for setting the
screen brightness on laptops and netbook computers.
Added 'runas' command, which allows you to run a new process with
the specified user name/password.
27/03/2011 2.52 Added 'Flash' action to the win command, with allows you to flash
the specified window.
Fixed bug in script: Sometimes the last line in the script was not
19/05/2009 2.36 executed properly.
01/04/2009 2.30 Added speak command - Speaks the contents of the text or file that
you specify, by using the Speech library (SAPI) that comes with
Windows XP and Windows Vista.
Added savescreenshotfull command.
Starting from this version, if you don't specify a sound device index
in setsysvolume, changesysvolume, setsysvolume2,
changesysvolume2 and mutesysvolume commands, the default sound
15/07/2006 1.84
device in control panel ("preferred device") is used.
New find options in win command: active, foreground, desktop
New variable: ~$clipboard$ - paste the text that you copied to the
clipboard into the command-line.
Parameter variables: ~$param.ParamName$ - Display an input
28/12/2004 1.56
window for typing the text that you want insert into the command-
line.
rasapi32.dll is now loaded only when using the dial commands (rasdial,
09/10/2004 1.52 rasdialdlg, rashangup). In previous versions, NirCmd was statically linked
to rasapi32.dll, and that caused problems in old NT systems.
Variable names are now enclosed with '$' char instead of '%' char.
I made this change because the '%' char causes problems when running
29/09/2004 1.51
NirCmd from cmd/bat file. using the '%' char for variable names is still
supported for backward compatibility.
New commands: cmdshortcut, regsvr, mutesysvolume,
changesysvolume, changesysvolume2, setsysvolume2.
New actions in win command: trans, setsize, settopmost, ititle.
22/09/2004 1.50 New variables: folder.nircmd, nir.exefile
nircmdc.exe - console version of NirCmd.
Changed name - from NirComLime to NirCmd.
License
This utility is released as freeware. You are allowed to freely distribute this utility via floppy disk,
CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute
this utility, you must include all files in the distribution package, without any modification !
Download NirCmd