NetWiki

I can make net work

User Tools

Site Tools


windows:command_prompt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
windows:command_prompt [2023-11-09 16:40] – [To change the Windows PATH] davewindows:command_prompt [2023-12-05 00:41] (current) – [For Loop Ping Sweep] dave
Line 55: Line 55:
 ==== For Loop Ping Sweep ==== ==== For Loop Ping Sweep ====
 From: https://www.rubyguides.com/2012/02/cli-ninja-ping-sweep/ From: https://www.rubyguides.com/2012/02/cli-ninja-ping-sweep/
 +<code>
  for /L %i in (1,1,255) do @ping -n 1 -w 200 192.168.1.%i > nul && echo 192.168.1.%i is up.  for /L %i in (1,1,255) do @ping -n 1 -w 200 192.168.1.%i > nul && echo 192.168.1.%i is up.
 +</code>
 As you can see the idea is the same, -n being the equivalent of -c in Linux’s ping and -w is the timeout, then we send the output to nul and echo only if the ping command was successful (that’s what the && is for) As you can see the idea is the same, -n being the equivalent of -c in Linux’s ping and -w is the timeout, then we send the output to nul and echo only if the ping command was successful (that’s what the && is for)
  
windows/command_prompt.txt · Last modified: 2023-12-05 00:41 by dave

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki