IP address variable

  • Thread starter Thread starter Henry
  • Start date Start date
H

Henry

Hi
I need to use the local ip address of a server in a
script. This script will run on various servers so I need
to get the variable or some method of getting this into
the script. Any ideas....?
 
Hi
I need to use the local ip address of a server in a
script. This script will run on various servers so I need
to get the variable or some method of getting this into
the script. Any ideas....?

See tip 7390 in the 'Tips & Tricks' at http://www.jsiinc.com

for /f "Tokens=2 Delims=[]" %%i in ('ping -n 1 "%computername%"') do set IP=%%i

If you type this, instead of placing it in a script, replace %% with %.



Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
Back
Top