Dirk98 0 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. Share this post Link to post Share on other sites
flyingboz 2 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. Share this post Link to post Share on other sites
Nahuel 1 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") Share this post Link to post Share on other sites
Dirk98 0 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. Share this post Link to post Share on other sites
Dirk98 0 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 Share this post Link to post Share on other sites
flyingboz 2 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. Share this post Link to post Share on other sites
Dirk98 0 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. Share this post Link to post Share on other sites
Dirk98 0 Posted September 21, 2007 Guys, thank you VERY much. Everyting works great! Share this post Link to post Share on other sites