Computing.Net > Forums > Programming > Ip address in Batch Files

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Ip address in Batch Files

Reply to Message Icon

Name: Touchpad_king
Date: May 21, 2003 at 18:29:10 Pacific
OS: 2.4
CPU/Ram: 256
Comment:

I want to make a batch file that every time someone opens it, it sends a messgage to my computer whoch displays their IP address. Is there any way I can program it to do that?



Sponsored Link
Ads by Google

Response Number 1
Name: SN
Date: May 21, 2003 at 21:05:25 Pacific
Reply:

Is it me or is this awfully virus sounding? Better give a good reason why you want something like this before anybody will venture to answer.
-SN


0

Response Number 2
Name: Daniel Ochonma
Date: May 22, 2003 at 05:30:42 Pacific
Reply:

Please i am currently doing a course that involves how the IP-Address is been calculated,Subnet address,domain control,Gateway Address,Binary number,Octal number etc.Can someone help me to understand how these things are working.

Daniel
Munich,Germany


0

Response Number 3
Name: Touchpad_king
Date: May 22, 2003 at 15:31:44 Pacific
Reply:

Hey! I need the IP address because my dad wants me to set up a new home network in order for my automatic shutdowner to work, I need the IP address of the computer. So I need something that tells me that every time They start up their computer, it runs the batch file(I know how to do that) and it needs to send me their IP address.
Thanks guys


0

Response Number 4
Name: HeXicode
Date: May 22, 2003 at 18:15:27 Pacific
Reply:

well there is a way, I read it in an old ms-dos book. but binding the IP Adress..well...ok i have an idea.
cd c:\windows\system
ipconfig?

that might not work....Why dont you re program ip config just a tad to make it only show the Ip? use qbasic or something.then bind it and -----Lets just say for a second
cd c:\windows\system
ipconfig2?
meh.....I'm still learning telnet with this aTROTIOS windows XP...ehem with my pentium 4 and yada yada yadaa.....can someone give me a link to telnet tutorials?


0

Response Number 5
Name: Touchpad_king
Date: May 22, 2003 at 19:18:26 Pacific
Reply:

Come on guys!! I need it for my remote shutdowner!


0

Related Posts

See More



Response Number 6
Name: SN
Date: May 22, 2003 at 23:25:38 Pacific
Reply:

I have no idea how to implement a "remote shutdowner", but here are a few of my thoughts.

1. You're going to hate this, but if this is just your dad's home network, why don't you just have the hub/router/switch/whatever assign static ip addresses? No fuss no muss. You seem like a smart enough guy that you already thought of this and it won't work for some reason, so I'll go on.

2. To my knowledge, it is very nearly impossible to "send a message" via a typical dos batch file. I assume by "send a message" you are referring to an e-mail. Security in most modern e-mail clients does not allow a message to be sent without a warning message to the user and a confirmation dialog box.

3. Assuming idea #1 won't work and #2 is true, then I would consider writing a batch file that simply runs ipconfig and outputs it to a file. This can be done in one line:

ipconfig>>c:\mydir\test.txt

Your "remote shutdowner" could then open this file over the network (easiest if you have a network drive mapped), parse it, and extract the ip address. Alternatively, you could change the command to write the file to the remote shutdowner's hard drive and your program could open it locally. Whichever is easier.

This is the only way I could think of that would work consistently (except for #1 of course)

Alternatively, as my first post implied, many viruses have exactly this behavior, so you may do some research there. They would have their own smtp engines. Some of them come as batch files(although not the lovely readable dos kind...I don't know how they do it)

Best of luck,
-SN


0

Response Number 7
Name: adigeh__
Date: May 23, 2003 at 00:20:39 Pacific
Reply:

I Disagree with SN,

I have hacked the schools netwrok couple of tmes , the security is so pathetic.
First of all , you'll need to locate the main fodler that holds the servers documents, you'll need to replace the shutdown.exe or logoff.exe but patch.exe [ ass sniffer maybe ] , so delete the logoff.exe or shutdown.exe, & replace it with patch.exe.bat,
this way whenever the computer reboots the patch file wont be removed.

Adigeh


0

Response Number 8
Name: Touchpad_king
Date: May 24, 2003 at 00:26:21 Pacific
Reply:

Thank you SN!!! I'm kind of a noob to COmmand prompt and stuuf but I'm learning!
I'm only 14!


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Ip address in Batch Files

IP address in Batch files www.computing.net/answers/programming/ip-address-in-batch-files/15602.html

batch file name date and time www.computing.net/answers/programming/batch-file-name-date-and-time/15060.html

Batch file to remote shutdown network PC's www.computing.net/answers/programming/batch-file-to-remote-shutdown-network-pcs/19105.html