NirCmd Command Reference - dlg

dlg [Process Name] [Window Title] [Action] [Parameters]
Allows you to interact with standard dialog-boxes and message-boxes of Windows. When a dialog-box is opened, you can use this command to "click" the ok/cancel/yes/no buttons, or fill the text-boxes in the dialog-box.
For example, the following commands fill the standard 'Run' dialog-box of Windows with 'calc.exe' process, and then click the 'OK' button. The '12298' is the control ID of the text-box in the Run dialog-box. You can find the control ID by using Spy++ of Microsoft, or by using my WinExplorer utility.
dlg "explorer.exe" "run" settext 12298 "calc.exe"
dlg "explorer.exe" "run" click ok

The following command will choose the 'Yes' answer for any question dialog-box of Explorer process:
dlg "explorer.exe" "" click yes

The following command will choose the 'Cancel' answer for any question dialog-box of any process:
dlg "" "" click cancel

Parameters description:

  • [Process Name]: Specifies the process that created the desired window. You can specify only the process name or the full path of the process. If this parameter is empty string("" ), the command will be executed on any process.
  • [Window Title]: Specifies the title of the window that you want the execute the action. If this parameter is empty string("" ), the command will be executed on any window, regardless the window title.
  • [Action]: You can specify one of the following options:
    • click: Click the specified button. You can specify one of the following predefined values (For standard Windows dialog-boxes only !): yes, no, ok, cancel, retry, ignore, close, help. You can also specify any control ID as numeric value.
    • settext: Set the text of the specified control. The first parameter of this action specifies the ID of the control, and the second parameter specifies the text.

Other commands:
abortshutdownbeepcdromchangeappvolumechangebrightness
changesysvolumechangesysvolume2clipboardclonefiletimecloseprocess
cmdshortcutcmdshortcutkeycmdwaitconsolewriteconvertimage
convertimagesdebugwritedlgdlganyelevate
elevatecmdemptybinexecexec2execmd
exitwinfilldeletegachibernateinetdial
infoboxinidelsecinidelvalinisetvalinitshutdown
killprocesslockwsloopmediaplaymemdump
monitormovecursormoverecyclebinmultiremotemuteappvolume
mutesubunitvolumemutesysvolumeparamsfileqboxqboxcom
qboxcomtopqboxtoprasdialrasdialdlgrashangup
regdelkeyregdelvalregeditregsetvalregsvr
remoterestartexplorerreturnvalrunasrunassystem
runinteractiveruninteractivecmdsavescreenshotsavescreenshotfullsavescreenshotwin
screensaverscreensavertimeoutscriptsendkeysendkeypress
sendmouseservicesetappvolumesetbrightnesssetconsolecolor
setconsolemodesetcursorsetcursorwinsetdefaultsounddevicesetdialuplogon
setdisplaysetfilefoldertimesetfiletimesetprimarydisplaysetprocessaffinity
setprocessprioritysetsubunitvolumedbsetsysvolumesetsysvolume2setvolume
shellcopyshellrefreshshexecshortcutshowsounddevices
speakstandbystdbeepsuspendprocesssuspendprocess
sysrefreshtrayballoonurlshortcutwaitwaitprocess
win

NirCmd Web Page

Download NirCmd

NirSoft Web Site