JSI Tip 7390. How do I set an environment variable to the IP address of the client computer in a logon script?

Jerold Schulman

October 29, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today


If your logon script requires that you retrieve the IP address of the client computer, add the following to the script:

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



Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like