#1
  1. No Profile Picture
    Designer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    258
    Rep Power
    11

    Script to Detect IP Address


    The company I work for has a xp computer in another region that we use to monitor security cameras for the warehouse.

    The problem is the IP address keeps changing and they do not want to purchase a static IP.

    The script needs to detect the IP address and then email it to the admin over here daily.

    Any help?

    Much thanks.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2004
    Posts
    2,102
    Rep Power
    1767
    save the following line as a .bat file

    ipconfig > c:\save_ip.txt


    this will write a text file with the current IP address to the C drive...

    set up a task scheduler to run the .bat file and then e-mail the text file to the remote e-mail address

    [edited]
    another way to retrieve the data is to run the .bat file then use an FTP client to transfer the file to the other system.
    Last edited by tj_nt; February 9th, 2007 at 12:10 PM.
  4. #3
  5. No Profile Picture
    Designer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    258
    Rep Power
    11
    Originally Posted by tj_nt
    save the following line as a .bat file

    ipconfig > c:\save_ip.txt


    this will write a text file with the current IP address to the C drive...

    set up a task scheduler to run the .bat file and then e-mail the text file to the remote e-mail address

    [edited]
    another way to retrieve the data is to run the .bat file then use an FTP client to transfer the file to the other system.
    What if I wanted to get the ip for the router? From that same workstation.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2004
    Posts
    2,102
    Rep Power
    1767
    if you run ipconfig it will return the local system IP as well as the gateway...which will be the router's IP if the system is patched into the network through a router. This will not do you any good as far as informing you of the IP so you can tunnel into the cams.

    What else is the remote system responsible for other than the cams?

    Have you considered installing Linux on the remote system?
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2007
    Posts
    1
    Rep Power
    0

    ISP Dynamic IP


    How do I do if I want to detect my ISP provided Dynamic IP?
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2008
    Posts
    1
    Rep Power
    0
    >>>How do I do if I want to detect my ISP provided Dynamic IP
    ISP provided Dynamic IP - it's you external IP.. you can find it here
    my-addr.com
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2008
    Posts
    39
    Rep Power
    6
    Why wouldn't you use a dynamic dns service like dyndns.com?

    http://www.dyndns.com/support/kb/usi...s_systems.html

    You install a client update applet on the pc and it keeps dyndns current with your camera's IP then you just reference it by name.

    Don't know about you, but I get enough email already, I don't need a camera emailing me with it's ip address. And what about the time from ip change until next email? It's ok to be out of touch that long? Finding a balance between email frequency and lag between updates to email would be a pain. And you know the time you need to reach it in a hurry is when it will be changed and not yet emailed.

IMN logo majestic logo threadwatch logo seochat tools logo