Skip to content

Instantly share code, notes, and snippets.

@mansouryaacoubi
Created December 6, 2018 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mansouryaacoubi/7606ef242d06811426d79be2a755b4f1 to your computer and use it in GitHub Desktop.
Save mansouryaacoubi/7606ef242d06811426d79be2a755b4f1 to your computer and use it in GitHub Desktop.
Batch to retrieve IP Address
@echo off
FOR /F "tokens=2,3" %%A IN ('ping %computername% -n 1 -4') DO IF "von"== "%%A" set "IP=%%~B"
echo %IP:~0,-1%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment