Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

what's the system variable to tcp/ip?, need to add to a batch file

Featured Replies

hello fellow msfn-ers!

i just have a quick Q, what is (or is there) a system variable that returns the value of the machines ip address? you know, kinda like %computername%, %tmp%, %date%, etc...

i've googled my q, but no results apply :(

thanks,

ceez

:thumbup


There is not a variable for the IP Address out of the box. You can see all the variables from a command prompt by typing SET.

I suppose you could add a computer startup script (in a GPO?) to automatically set a variable on each boot.

Just remembered this utility:

http://www.jsifaq.com/SF/Tips/Tip.aspx?id=4445

You could use it from the startup script by calling:

for /f "Tokens=*" %%i in ('techops /ip') do set IP=%%i

Of course there is always VBScript. Or any scripting language of your choice.

Edited by BlkCrowe

ipconfig works great if only one connection is etablished ...

If there is two or more connections, there are more IP, more complicated to treat ...

But you can pickup just the ip begin with 192.168. for example :

@echo off
for /f "tokens=2 delims=:" %%? in ('ipconfig^|find "Adresse IP"^|find "192.168."') do set ip=%%?
set ip=%ip:~1%
echo IP : %ip%
pause

edit: Replace "Adresse IP" by your language, try ipconfig and look the text ... (Adresse IP is for French version)

  • Author

hey everyone, thanks for your input.... @ nitroshift, I second that motion....I am also CR/-\[]D at scripting!

@sonic, I'll look into that batch command. will that set a variable in the system so everytime I go to start-run and type %ip% it will return the system IP? this way I can freely use the %ip% variable in any other situation that might come up?

thanks again everyone!

ceez

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.