1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Batch file for obtaining IP address

Discussion in 'Web & Email' started by mherbert, Oct 19, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. mherbert

    mherbert Thread Starter

    Joined:
    Jul 21, 2003
    Messages:
    11
    I maintain my mothers computer remotely using PC Anywhere. The problem is that of acquiring her IP address when online which changes each time she is online.

    I would like to create a batch file that she could activate which would automatically email me her IP address using the Ipconfig /batch utility for Windows 98. I can get the file created but I can't figure out how to get it to send itself to me.

    Can anyone help?

    Thanks.
     
  2. sekirt

    sekirt

    Joined:
    Mar 28, 2003
    Messages:
    3,998
    You might have more luck posting in the Development Forum?

    I can give you an idea for an email shortcut.

    Create a new shortcut on your desktop.
    Do this by right clicking on the desktop and choosing New. Then Shortcut, from the context menu that pops up.

    In the "Command Line" text box type the email address of the person in this format, "Mailto:[email protected]?subject=IP address" without the quotes. Note: there are no spaces between any letters or characters.

    Click "Next," give the Shortcut a name and click on Finish. When clicked this will open up an email all filled out to you with the subject "IP address." If you have some way to get the info into the email directly from the batch file, OK. If not, maybe your mom can copy it into the email?

    sekirt
     
  3. Ratboy

    Ratboy

    Joined:
    Feb 12, 1999
    Messages:
    1,220
    mherbert,

    Welcome to TSG!

    You can do it by creating two files: A shortcut and a batchfile.

    Shortcut: Create the shortcut using the following in the Command line:

    mailto:[email protected]?subject=IP Address&attachment="c:\stuff\ipconfig.txt"

    In this example I've named the shortcut: mailit and saved it to the c:\stuff\ directory.

    Batch File: Create a batch file with the following lines:

    ipconfig /batch c:\stuff\ipconfig.txt
    start c:\stuff\mailit.url



    The first line of the batch file takes the information provided by the command IPCONFIG and saves it to a file called: ipconfig.txt.

    The second line runs the shortcut created called: mailit. Be sure to include extension .url.

    The Command line on the shortcut tells the default email client to send an email to the address: [email protected], put IP Address in the Subject line and include the attachment ipconfig.txt.

    Save the batch file to the desktop and all your Mom has to do is run the batch file and then click Send, when the email window comes up.
     
  4. sekirt

    sekirt

    Joined:
    Mar 28, 2003
    Messages:
    3,998
    Ratboy

    Everything works except attaching the text file.
    I think I have tried every combination of your instructions.
    Using OE6.

    &attachment=
    &attach=
    &attachment="path with quotes and without quotes"

    Can you shed any light on what might be wrong?
    Don't need these command line options, just thought I would try it.
    sekirt
     
  5. Ratboy

    Ratboy

    Joined:
    Feb 12, 1999
    Messages:
    1,220
    sekirt,

    You are right. It doesn't seem to work with OE 6. I'm not sure why.

    I had Outlook 2000 set as my default email client when I tested the commands. I assumed that they would work for either email client.

    I'll see if I can come up with a solution for OE and post back.

    Thanks for the heads up. (y)
     
  6. sekirt

    sekirt

    Joined:
    Mar 28, 2003
    Messages:
    3,998
    I haven't found anything for attaching a file.
    The closest I can get, is to print a message into the body of the email.

    &body=anything I want to print, typed in here

    sekirt
     
  7. Squashman

    Squashman Trusted Advisor

    Joined:
    Apr 4, 2003
    Messages:
    19,783
  8. mherbert

    mherbert Thread Starter

    Joined:
    Jul 21, 2003
    Messages:
    11
    Thanks for getting back to me guys. You've given me some things to give me a start.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/173014

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice