NirCmd – Zaharra tresna lanak automatizatzeko
Gaur asteko utilitate bat aurkezten dizuet, eta aste honetan zeregin bitxi bati aurre egiteko salbatu nau, Bezero batekin erabiltzaileen Zenbaki batean zerbait zuzendu behar nuen, Ez dakigu nola automatizatu zeregin hori, ez delako erregistro gako bat aldatzea, Ez da komando bidez egin daiteke, Ezta GPO bidez ere, eta abar… Eta erabiltzailearen esku hartzea eskatzen du. Beraz bitxikeriaz, hainbat funtzionalitate dituen tresna bat aurkitu nuen, Horietako bat pantailari teklatu-konbinazioak bidaltzea da, Beraz, aplikazio bat ireki ahal izango dugu & Gure beharrezko teklatu-konbinazioak bidaltzea aukera bat markatzeko.
Hablamos de NirCmd, una herramienta ya bastante vieja que nos permitirá automatizar tareas sin la intervención del usuario, podremos modificar el registro, ficheros ini, marcar conexiones de internet/VPN, modificar fechas de ficheros, cambiar el tamaño del display, abrir la bandeja del CD… Otra gran app de NirSoft. Descargar NirCmd de su web oficial.
Por poner un ejemplo, sabemos todos que al ejecutar 'RunDll32.exe InetCpl.cpl,ResetIEtoDefaults’ abrimos lo de restaurar las opciones del Internet Explorer, ez? Onena, con este siguiente comando veremos cómo abrir dichas opciones & como tabularemos, pulsaremos la tecla 'R’ para que restaure & luego le dará al 'Enter’ para aceptar:
start RunDll32.exe InetCpl.cpl,ResetIEtoDefaults ping 127.0.0.1 -w 1 -n 2 > NUL 2>&1 \PATHnircmdNirCmd.exe sendkey alt down \PATHnircmdNirCmd.exe sendkey R press \PATHnircmdNirCmd.exe sendkey alt up ping 127.0.0.1 -w 1 -n 3 > NUL 2>&1 \PATHnircmdNirCmd.exe win activate title "Reset Internet Explorer Settings” \PATHnircmdNirCmd.exe sendkey enter press
Por lo que al ejecutar el anterior comando, al usuario se le reseteará las opciones de Internet, sin perder la configuración personal (adibide bat jartzearren). Qué más se puede hacer:
| 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: |
| Speaks the text currently in the clipboard (For Windows XP/Vista/7/8). | speak text ~$clipboard$ |
| Speaks the text stored inside speak.txt into speak.wav filename (For Windows XP/Vista/7/8). | speak file “c:tempspeak.txt” 0 100 “c:tempspeak.wav” 48kHz16BitStereo |
| 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 |
| Bolumena balio altuenera ezarri | nircmd.exe setsysvolume 65535 |
| Sistema bolumena isilarazi | nircmd.exe mutesysvolume 1 |
| Sistema bolumena isilarazi ezazu | nircmd.exe mutesysvolume 0 |
| Sistema bolumena isilarazi eta normalean aldatzearen artean aldatu. | nircmd.exe mutesysvolume 2 |
| Sortu mahaigainean lasterbide bat sistema bolumena isilarazi eta normalean aldatzeko. | nircmd.exe cmdshortcut “~$folder.desktop$” “Bolumena Aldatu” mutesysvolume 2 |
| Monitorra itzali | nircmd.exe monitor off |
| Lehenetsitako pantaila babeslea abiarazi | nircmd.exe screensaver |
| Zure ordenagailua 'standby' moduan jarri’ mode | nircmd.exe standby |
| Uneko erabiltzailea saioa itxi | nircmd.exe exitwin logoff |
| Galde berrabiarazi nahi duzun, eta 'Bai' erantzuten baduzu, Ordenagailua berrabiarazi. | nircmd.exe qboxcom “Berrabiarazi nahi duzu? ?” “galdera” exitwin reboot |
| Zure ordenagailua itzali | nircmd.exe exitwin poweroff |
| comuters.txt-ean zehaztutako ordenagailu guztiak itzali ! | multiremote copy “c:tempcomputers.txt” exitwin poweroff force |
| Deitu “Nire Internet” konexioa | nircmd.exe rasdial “Nire Internet” |
| Deskonektatu “Nire Internet” konexioa | nircmd.exe rashangup “Nire Internet” |
| Egin zure Internet Explorer leihoak 75% gardena ! (192 / 256) | nircmd.exe win trans ititle “internet explorer” 192 |
| Minimiza ezazu zure Internet Explorer leiho guztiak | nircmd.exe win min class “IEFrame” |
| Itxi ezazu zure Internet Explorer leiho guztiak | nircmd.exe win close class “IEFrame” |
| Itxi ezazu Explorer leiho guztiak (Nire Ordenagailua, karpetak, eta abar) | nircmd.exe win close class “CabinetWClass” |
| Ezkutatu zure Internet Explorer leiho guztiak | nircmd.exe win hide class “IEFrame” |
| Erakutsi zure Internet Explorer leiho guztiak (lehenengo adibidean ezkutatuak izan ondoren) | nircmd.exe win show class “IEFrame” |
| Zentratu goiko mailako leiho guztiak | nircmd.exe win center alltop |
| Kendu Nire Ordenagailua leihoaren izenbarraren barra. | nircmd.exe win -style title “nire ordenagailua” 0x00C00000 |
| Itzuli Nire Ordenagailua leihoaren izenbarrako barra, lehenengo adibidean kendu genuena. | nircmd.exe win +style title “nire ordenagailua” 0x00C00000 |
| Ezarri Nire Ordenagailuaren leihoa eskuinetik-ezkerako ordenean (Hebreerako eta arabierako hizkuntzetarako) | nircmd win +exstyle title “nire ordenagailua” 0x00400000 |
| Ezarri Nire Ordenagailuaren leihoaren azpiko leihorik guztiak eskuinetik-ezkerako ordenean (Hebreerako eta arabierako hizkuntzetarako) | nircmd win child title “nire ordenagailua” +exstyle all 0x00400000 |
| Sortu zure mahaigainera lasterbide bat zure Internet Explorer leiho guztiak ixteko | nircmd.exe cmdshortcut ” “~$folder.desktop$ “Itxi IE Guztiak” win close class “IEFrame” |
| Sortu zure mahaigainera lasterbide bat zure Internet Explorer leiho guztiak ezkutatzeko | nircmd.exe cmdshortcut ” “~$folder.desktop$ “Ezkutatu IE Guztiak” win hide class “IEFrame” |
| Sortu zure mahaigainera lasterbide bat zure Internet Explorer leiho guztiak berriro ikusteko | nircmd.exe cmdshortcut ” “~$folder.desktop$ “Erakutsi IE Guztiak” win show class “IEFrame” |
| Ezarri Windows Kalkulagailua leiho gorenena (beste leiho guztien gainetik) | nircmd.exe win settopmost title “Kalkulagailua” 1 |
| Ezarri Windows Kalkulagailua leiho arrunt bezala berriro (ez da leiho gorenena) | nircmd.exe win settopmost title “Kalkulagailua” 0 |
| Create a shortcut to Windows calculator under Start Menu->Programs->Calculators | nircmd.exe shortcut “f:winntsystem32calc.exe” “~$folder.programs$Calculators” “Windows Calculator” |
| Hide the desktop window | nircmd.exe win hide class progman |
| Show the desktop window (After hiding it in previous example) | nircmd.exe win show class progman |
| Hide the start button on the system tray | nircmd.exe win child class “Shell_TrayWnd” hide class “button” |
| Show the start button on the system tray | nircmd.exe win child class “Shell_TrayWnd” show class “button” |
| Hide the clock on the system tray | nircmd.exe win child class “Shell_TrayWnd” hide class “TrayClockWClass” |
| Show the clock on the system tray | nircmd.exe win child class “Shell_TrayWnd” show class “TrayClockWClass” |
| Kill (terminate) all instance of Internet Explorer processes | nircmd.exe killprocess iexplore.exe |
| 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” |
| Gehitu NirSoft Webgunea zure Gustukoen artean Links karpetan. | nircmd.exe urlshortcut “http://www.nirsoft.net” “~$folder.favorites$Links” “NirSoft” |
| Sortu laburbide bat NirSoft Webgunera computers.txt-n dauden ordenagailu guztien mahaigainean | nircmd.exe multiremote copy “c:tempcomputers.txt” urlshortcut “http://www.nirsoft.net” “~$folder.common_desktop$” “NirSoft” |
| Ezarri erakusteko modua 800x600x24bit koloreetan | nircmd.exe setdisplay 800 600 24 |
| Sortu mahaigainan laburbide bat erakusteko modua 800x600x24bit koloreetan ezartzen duena | nircmd.exe cmdshortcut “~$folder.desktop$” “800x600x24” setdisplay 800 600 24 |
| Kopiatu zure mahaigaineko laburbide guztiak beste karpeta batean (f:tempdesktop). | nircmd.exe execmd copy “~$folder.desktop$*.lnk” f:tempdesktop |
| Berabiarazi zure Apache zerbitzaria (Windows NT/2000/XP/2003 azpian) | nircmd.exe service restart apache |
| Sortu mahaigainan laburbide bat Apache zerbitzaria berabiarazten duena | nircmd.exe cmdshortcut “~$folder.desktop$” “Berabiarazi Apache” service restart apache |
| Berabiarazi zure IIS | nircmd.exe service restart w3svc |
| Berabiarazi MySql | nircmd.exe service restart MySql |
| Open the desired Registry key/value in RegEdit | nircmd.exe regedit “HKLMSoftwareMicrosoftWindowsCurrentVersion” “CommonFilesDir” |
| Open the Registry key that you copied to the clipboard in RegEdit. | nircmd regedit “~$clipboard$” |
| Disable the screen saver | nircmd.exe regsetval sz “HKCUcontrol paneldesktop” “ScreenSaveActive” 0 |
| Enable the screen saver | nircmd.exe regsetval sz “HKCUcontrol paneldesktop” “ScreenSaveActive” 1 |
| Change the date/time of the specified filename (creation time and modified time) | nircmd.exe setfiletime “c:tempmyfile.txt” “24-06-2003 17:57:11” “22-11-2005 10:21:56” |
| Copy your desktop folder path to the clipboard | nircmd.exe clipboard set ~$folder.desktop$ |
| Copy your start menu folder path to the clipboard | nircmd.exe clipboard set ~$folder.start_menu$ |
| Copy the content of info1.txt (simple text file) to the clipboard | nircmd.exe clipboard readfile “c:My Filesinfo1.txt” |
| Add the text content of clipboard to info1.txt | nircmd.exe clipboard addfile “c:My Filesinfo1.txt” |
| Clear the clipboard | nircmd.exe clipboard clear |
| Create all folders specified in “c:tempfolders.txt”. The folder path names are separated by CRLF characters. | nircmd.exe paramsfile “c:tempfolders.txt” “” “” execmd md ~$fparam.1$ |
| Install the specified .NET assembly in the global assembly cache (like gacutil) | nircmd.exe gac install “C:tempMyAssemblybinMyAssembly.dll” |
| Empty the recycle bin in all drives. | nircmd.exe emptybin |
| Answer ‘Yes’ to a standard Windows message-box. | nircmd.exe dlg “” “” click yes |
| Wait 2 seconds, and then save the current screen to shot.png | nircmd.exe cmdwait 2000 savescreenshot “f:tempshot.png” |
| Gorde 10 screenshots in a loop, and wait 60 seconds between the screenshot save calls. The filenames of the screenshot will contain the time and date of the saved screenshot. | nircmd.exe loop 10 60000 savescreenshot c:tempscr~$currdate.MM_dd_yyyy$-~$currtime.HH_mm_ss$.png |
| Wait until Firefox is closed, and then say “Firefox was closed” | nircmd.exe waitprocess firefox.exe speak text “Firefox was closed” |
| Run RegEdit with SYSTEM user (On Windows 7/8/Vista/2008), which allows you view all hidden system Registry notes | nircmd.exe elevatecmd runassystem c:windowsregedit.exe |








































