Dirk98 Posted September 21, 2007 Share Posted September 21, 2007 Guys, I'm behind a router in a local LAN. I need a script to read my current WAN address and write it in the DESKTOP shortcut as follows: CROWN.exe has a shortcut on the desktop named "Crown". So if the script learns my current WAN is 83.146.26.254 it writes it down in the shortcut's text on the desktop as "Crown -83.146.26.254". Any ideas, please? Many thanks. Link to comment Share on other sites More sharing options...
flyingboz Posted September 21, 2007 Share Posted September 21, 2007 Guys, I'm behind a router in a local LAN. I need a script to read my current WAN address and write it in the DESKTOP shortcut as follows:CROWN.exe has a shortcut on the desktop named "Crown". So if the script learns my current WAN is 83.146.26.254 it writes it down in the shortcut's text on the desktop as "Crown -83.146.26.254". Any ideas, please?Many thanks.there are a hundred websites that will tell you your ip address. go to one and parse the result.alternate method....if you have a web server you own, hit it with a funky nonexistent web page, then parse the log for the source ip of the offending hit.... Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
Nahuel Posted September 21, 2007 Share Posted September 21, 2007 Guys, I'm behind a router in a local LAN. I need a script to read my current WAN address and write it in the DESKTOP shortcut as follows: CROWN.exe has a shortcut on the desktop named "Crown". So if the script learns my current WAN is 83.146.26.254 it writes it down in the shortcut's text on the desktop as "Crown -83.146.26.254". Any ideas, please? Many thanks. This does what you want: $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("GET", "http://www.whatismyip.org/", False) $oHTTP.Send() $oIP = $oHTTP.ResponseText FileMove(@DesktopDir&"\CROWN.lnk",@DesktopDir&"\CROWN -"&$oIP&".lnk") Link to comment Share on other sites More sharing options...
Dirk98 Posted September 21, 2007 Author Share Posted September 21, 2007 This does what you want: $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("GET", "http://www.whatismyip.org/", False) $oHTTP.Send() $oIP = $oHTTP.ResponseText FileMove(@DesktopDir&"\CROWN.lnk",@DesktopDir&"\CROWN -"&$oIP&".lnk") Thank you, Nahuel, will try it now. Link to comment Share on other sites More sharing options...
Dirk98 Posted September 21, 2007 Author Share Posted September 21, 2007 (edited) This does what you want: $oHTTP = ObjCreate("Microsoft.XMLHTTP") $oHTTP.Open("GET", "http://www.whatismyip.org/", False) $oHTTP.Send() $oIP = $oHTTP.ResponseText FileMove(@DesktopDir&"\CROWN.lnk",@DesktopDir&"\CROWN -"&$oIP&".lnk") Excellent, Nahuel! It works and the code is very short. Just one note: turns out I need to ENTER my WAN IP not in the CROWN.lnk but in the properies of the CROWN.lnk as follows: (EXAMPLE) In Crown Properties > Shortcut> Target: C:\Program Files\Crown\Crown.exe -83.146.26.254 I guess it should be easy now, but I only guess, have no idea how to call on that Target box in the Properties>Shortcut. Edited September 21, 2007 by Dirk98 Link to comment Share on other sites More sharing options...
flyingboz Posted September 21, 2007 Share Posted September 21, 2007 Excellent, Nahuel! It works and the code is very short.Just one note: turns out I need to ENTER my WAN IP not in the CROWN.lnk but in the properies of the CROWN.lnk as follows:(EXAMPLE)In Crown Properties > Shortcut>Target: C:\Program Files\Crown\Crown.exe -83.146.26.254 I guess it should be easy now, but I only guess, have no idea how to call on that Target box in the Properties>Shortcut.read the manual.......FileCreateShortCut() Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
Dirk98 Posted September 21, 2007 Author Share Posted September 21, 2007 read the manual.......FileCreateShortCut()Thanks flyingboz, will this command create new shortcuts every time it will find that the IP has changed? I need only one instance of this shortcut on the desktop. I'll try in the meantime.Thanks. Link to comment Share on other sites More sharing options...
Dirk98 Posted September 21, 2007 Author Share Posted September 21, 2007 Guys, thank you VERY much. Everyting works great! 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