ceez Posted November 7, 2006 Share Posted November 7, 2006 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 Link to comment Share on other sites More sharing options...
BlkCrowe Posted November 7, 2006 Share Posted November 7, 2006 (edited) 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=4445You 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 November 7, 2006 by BlkCrowe Link to comment Share on other sites More sharing options...
nitroshift Posted November 7, 2006 Share Posted November 7, 2006 (edited) You can try scripting along the line of ipconfig /all. I'd like to help you, but I'm cr/-\p at scripting Edited November 7, 2006 by nitroshift Link to comment Share on other sites More sharing options...
Sonic Posted November 7, 2006 Share Posted November 7, 2006 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 offfor /f "tokens=2 delims=:" %%? in ('ipconfig^|find "Adresse IP"^|find "192.168."') do set ip=%%?set ip=%ip:~1%echo IP : %ip%pauseedit: Replace "Adresse IP" by your language, try ipconfig and look the text ... (Adresse IP is for French version) Link to comment Share on other sites More sharing options...
ceez Posted November 9, 2006 Author Share Posted November 9, 2006 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now