• OFF TOPIC fun forum - NO politics - NO religion - NO jerks. It's not complicated. Thanks!

MS Batch File Help

Status
Not open for further replies.

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
Ideally, I need a batch file to autorun from a USB drive when plugged in that boots Command Prompt and then runs the "ipconfig /all" command. This way I can plug in the flash drive and quickly pull the computer's IP address. What would be even better is if the program would write a .txt file to the flash drive with the entire "ipconfig /all" info stored in it.

Does anyone have any knowledge in this field? Even just the program to run ipconfig /all would be great as that's the first of my 3 goals.

1) Batch file that runs ipconfig /all
2) Auto runs from a flash drive when plugged in
3) Writes ipconfig /all info to .txt file on flash drive

Thanks!
 

kendelrk

redneck engineer
Messages
2,425
Reaction score
7
Location
westland michigan
why exactley are you looking to get the IP address? there are some programs you can get to pull it for you, and then you can copy, paste that into a .txt file and there you go,
 

HellSpawn

New member
Messages
476
Reaction score
2
Location
Wadena, Minnesota
create a autorun.inf file on the usb drive, place this in autorun:

[AutoRun]
OPEN=ipconfig.bat

Then create your ipconfig.bat in the same directory of your autorun. inside of the batch file:

@echo off
ipconfig /all | find "Host Name" > %computername%.txt
ipconfig /all | find "IP Address" >> %computername%.txt
ipconfig /all | find "DNS" >> %computername%.txt

This way, you'll also get a name of the computer as not to have a bunch of mumble jumble and not know whats what.
 

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
HellSpawn, just copy the quoted text into the two respective files and I'm good to go?
 

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
It's mostly just for messing around with friends. I found a free Android app called WifiKill. If you have the computer's IP and are on the same network, you can disable their conneciton with the flip of a check box and then have the bandwidth to yourself.

Thanks for this. I just made it now, but as a student here, autorun files are blocked. Maybe I'll go pop this into a teacher's computer... :D
 

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
Ok, just tried this out...it makes the file named as the computer, but it's blank inside. How can I change this so that it adds the IP to the file?
 

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
Why not just use Network Discovery from the android market
it will show you every IP connected to a given network.

The app shows every IP on the network, and when we're on laptops at school, there's over 800 devices on the wireless network. I want something that I can pop in, count to 5, and pull back out with their computer's IP so I can go into the list of 800+ on my phone, and block theirs as a joke. (yes, the app sorts close to sequentially, the IP range is 10.1.48.___ through 10.1.53.___, so it would take too long without sorting)
 

HellSpawn

New member
Messages
476
Reaction score
2
Location
Wadena, Minnesota
Ok, just tried this out...it makes the file named as the computer, but it's blank inside. How can I change this so that it adds the IP to the file?

Your school probably has use of cmd prompt blocked. Id assume anyway. If you want I can probably write you a quick little program in C# that'll yankypoo the info you want.
 

redsox985

Active member
Messages
4,092
Reaction score
11
Location
PA
We don't have the command prompt in the start menu anywhere, but if we go into notepad then type command.com and save to the desktop as command.bat, we have a limited command prompt. Enough to open a flash drive as My Computer is locked.
 

HellSpawn

New member
Messages
476
Reaction score
2
Location
Wadena, Minnesota
most of the functionality is probably blocked then. Just lemme know if you want a simple little proggie to pull that for you. Could be setup to just log to a .txt file and whatever else you need. Would take me like a minute, literally lol.
 
Status
Not open for further replies.
Top