Kayıtlar

CMD etiketine sahip yayınlar gösteriliyor

Scan IP range using ping

Resim
P scanner for the poor ones  Just open up a cmd.exe and change the ip range.. C:\>FOR /L %x in (1,1,255) do ping -n 1 192.168.2.%x | find /I "reply" >> c:\temp\pingresult.txt The above command uses a FOR loop to ping each device and looks for "Reply" in the output. If there is a "Reply" then the host is up.. Results will be written to C:\temp\pingresults.txt Or the PowerShell version: C:\> 1..255 | foreach-object { (new-object System.Net.Networkinformation.Ping).Send("192.168.2.$_") } | where-object {$_.Status -eq "success"} | select Address Address ——- 192.168.2.1 192.168.2.5 192.168.2.10 192.168.2.11 192.168.2.12 At first glance the results are very similar and you would think, "Why all the extra typing? The second command is 2.5 times longer!" The big difference between the standard windows command line and powershell is that the latter uses objects, which gives a lot of power…in our shell.

CMD: Search and copy specific files on your computer

Okay, i just had to search for specific files on my computer and i wanted to have them copied to a specific folder. This is some kind of note for myself but maybe you can make use of it too .. don’t know. c:\>FOR /F "Tokens=*" %i in (‘DIR /B /S *map*.png’) do md "c:\temp\icons\map%~pi " | copy "%i" "c:\temp\icons\map%~pi"