Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I need a command line something to put my public IP address in a text file?

I would like to run a batch file that runs a command line 'something' that gets my public IP address and puts it or echos it to a text file.

I'll then ftp that text file to my ftp site.

So I will be able to find what dynamic IP address my provider gave me.

I would have a scheduled event run the script each day.

I know that there are web pages that tell you what your public IP address is but I don't know how to get that information into a plain text file.

And I can find what I want in the Linux world but I need it to work in Windows xp.

Can anyone help me out?

Update:

Well I have about 300 devices. each connected to a cell phone data-plan. The data-plan provider cannot give static ips, just dynamic. These devices are windows based but very close to thin client in that most built-in windows commands and default programs are there but I really can't be installing any new software on them.And any of these dynamic ip dns types of companies would want to charge me too much money when I am just trying to make my 'maintainer' role easier to accomplish.

4 Answers

Relevance
  • McFate
    Lv 7
    8 years ago
    Favorite Answer

    If it's a Windows XP system that you control, you could install ActivePerl. Then you could use Perl's CGI package to make a HTTP connection to whatismyipaddress.com (or equivalent) and then find the IP address among the returned text.

    @M

  • ?
    Lv 6
    8 years ago

    There's a very easy solution:

    Upload a tiny PHP page to some server (it can be a free server). This page would track the IP of its visitors. On your Windows machine(s) simply tell the scheduler to access this page every few hours.

    Here's the source for the PHP page:

    http://www.typo.co.il/~mooffie/tmp/ip-tracker.php....

    Save it to your computer, rename it to 'ip-tracker.php', and upload it to some server that supports PHP.

    Click here to see it in action:

    http://www.typo.co.il/~mooffie/tmp/ip-tracker.php

    (How to make sure only you access this page? Don't publish its address. Or tweak the PHP code a bit to expect a certain word in the URL.)

  • 8 years ago

    Its probably easier to attack the problem from a different angle. DDNS providers such as no-ip and dyndns already provide tools to do this sort of task. You get a domain name from them (free if you avoid the paid options) and use their tool to keep your domain name's address up to date. No need for any text files or stuff bring uploaded.

  • anto
    Lv 6
    8 years ago

    Can be done using VBscript, all you have to do is a connexion to http://ifconfig.me/ip

    or use curl or wget I know you said you can't download anything..

Still have questions? Get your answers by asking now.