Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.69 KB | None | 0 0
  1. @echo off
  2. chcp 65001
  3. setlocal enabledelayedexpansion
  4.  
  5. set direccioncomostring="Dirección IP"
  6.  
  7. for /F "usebackq tokens=2 delims=:" %%f in (`ipconfig ^| findstr /c:%direccioncomostring%`) do (
  8.   echo %%f > ip.txt
  9.   goto :start
  10. )
  11.  
  12. :start
  13. for /F "useback tokens=1-3 delims=." %%a in ("ip.txt") do (
  14.   echo Dirección IP detectada, extracción del último octeto: %%a.%%b.%%c
  15.   echo -----------------------------------------------------------------------------------------
  16.   set direcciones=%%a.%%b.%%c
  17. )
  18.  
  19. for /L %%z in (1,1,254) do (
  20.   ping -n 1 %direcciones%.%%z | findstr "TTL" >> dirs.txt
  21.   set /a "porcentaje=(%%z*100)/254"
  22.   echo !porcentaje!%% - %direcciones%.%%z
  23. )
  24.  
  25.  
  26. goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement