Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Help with a little script i wrote.


ghost's Avatar
0 0

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.


spyware's Avatar
Banned
0 0

Sounds like you're better off writing the more complicated stuff in C#.


ghost's Avatar
0 0

Thought that might be the case. I am going to re-write it in python just to learn a little more python because i enjoy it so. Do you think there would be a way to stop this box in python?

Thank you for your Reply

Relentless


ghost's Avatar
0 0

w00t! Python FTW! :)

If there is a way to do it, Richo would probably know :)


ghost's Avatar
0 0

Nice one thanx :)

Relentless


AldarHawk's Avatar
The Manager
0 0

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


ghost's Avatar
0 0

Lol yes i should have included that i said in another thread that there is a much simpler way of doing this and yes i am insane :D hehe. This was just an experiment but i have learnt somthing from it so i would not call it a waste of time.

Cheers for the Input.

Relentless.B)