windows:command_prompt
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
windows:command_prompt [2023-11-09 16:40] – [To change the Windows PATH] dave | windows: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:// | From: https:// | ||
+ | < | ||
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. | ||
+ | </ | ||
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