Help with a little script i wrote.
Hey everyone,
I was wondering if someone could help me out with the following problem.
I have written a simple .bat script that looks like the following:
@echo off Echo. Echo script running… Echo. Echo Expect a 10 second delay between "ok."
:main netsh interface ip set address "Local Area Connection" source=static addr=172.16.1.204 mask=255.255.255.0
ping -n 10 localhost > nul
netsh interface ip set address "Local Area Connection" source=static addr=172.16.1.205 mask=255.255.255.0
ping -n 10 localhost > nul
netsh interface ip set address "Local Area Connection" source=static addr=172.16.1.206 mask=255.255.255.0
ping -n 10 localhost > nul
netsh interface ip set address "Local Area Connection" source=static addr=172.16.1.207 mask=255.255.255.0
ping -n 10 localhost > nul
ect ect ect ect…….
goto main
pause
What it does is changes the IP of the machine it is running on to every 172.16.1.* combination thus knocking all other computers off the LAN. But every time it changes an IP a box is displayed saying please change IP settings because there is an IP conflict, which is expected, but you have to select ok to the message before the .bat script continues to run. I was wondering if anyone knows how to stop this so I could make it totally automated.
Any help would be highly appreciated.
Relentless.
on this it is just a waste…why not put it into a loop to make it read through all the IPs? If you are writing out every single 254 IP addresses you must be crazy. And also note that this will not always work. It can yes but not always. I would suggest getting a life and coding something actually worth while instead of a mass flooder. IP Flooders are a waste of code IMHO. But again this is coming from someone who stops idiots who use them for a living :P
anyways your code is extremely flawed because you could simply place this into a loop and save yourself like 250 lines of code :D