Jump to content

chosey

Member
  • Posts

    4
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Ireland

About chosey

Profile Information

  • OS
    none specified

chosey's Achievements

0

Reputation

  1. Beautiful, that did the trick. Thank you! I'm still trying to follow the syntax but it's working perfectly. Thanks a lot. Nir
  2. Hi Yzöwl, Sorry if I wasn't clear about this, I'm pretty new to this stuff. the blacklist.txt should contain IPs which will be excluded from the ping. for each line of the win-segment.txt file the script should verify if the IP is in the blacklist.txt file. if the IP does not exist it should ping it and write it in the alive.txt file. If the IP exists it should be skipped. Thanks, Nir
  3. Hi Jaclaz, Thanks for the response. When I run your proposed script I see it ping the IPs in the blacklist. Nir
  4. Hi all, I'm trying to write down a script to check if hosts are a alive in a subnet. The script takes the IP list to ping from win-segment.txt and also there's this file blacklist.txt for exclusions. I guess I'm missing something here because since I added the "blacklist" feature, the script does not run and I can't understand where it fails. This is the script: SetLocal EnableDelayedExpansion del alive.txt del nosysaid.txt for /f %%q in (win-segment.txt) do ( set found = 0 for /f %%s in (blacklist.txt) do ( if %%q == %%s (set found = 1) if %found% = 1 ( ping %%q -n 1 -w 20 if !errorlevel! == 0 echo %%q >> alive.txt) pause ) ) I'd really appreciate if someone could tell me what I did wrong. Thanks, Nir
×
×
  • Create New...