Jump to content

Help with a batch file problem please

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
way_2_hot_a

way_2_hot_a

    Newbie

  • Members
  • Pip
  • 4 posts
Ok this is my code but it seems that its not working.. The reason i made this is because my internet disconnects "stops receiving packets" until i end the connection and redial the pppoe connection. Any help would be greatly appreciated. thanks again


@ECHO OFF

:Game

PING www,google,com |FIND "Reply from " > NUL

IF NOT ERRORLEVEL 1 ECHO Internet connection is reciving packets boss.

IF ERRORLEVEL 1 rasdial dsl /disconnect GOTO:protocol

:protocol 

PING www,google,com

PING www,google,com

PING www,google,com

cd "%ProgramFiles%\DSL" && START dsl"

PING www,google,com

PING www,google,com GOTO:protocol3

:protocol3

PING www,google,com |FIND "Request timed " > NUL

IF NOT ERRORLEVEL 1 rasdial dsl /disconnect GOTO:protocol

IF ERRORLEVEL 1 GOTO:Game



i used so many pings for delay reasons. so my pc has time to perform the action before a new function starts something.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
What is it doing?

Why not use PAUSE to create the desired delays?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
way_2_hot_a

way_2_hot_a

    Newbie

  • Members
  • Pip
  • 4 posts

WingedPanther said:

What is it doing?

Why not use PAUSE to create the desired delays?

As i explained above it is supposed to end the pppoe connection, and start it back up when it stops receiving reply from the desired website. i dont use pause because it wouldn't be automatic anymore..

I don't know how to explain it any better, disconnects the connection and restarts it...

Any help would be appreciated.. thanks

#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Are you getting error messages? In what sense is it not working?

There is a huge difference between what you want it to do and what you observe it to be doing.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#5
way_2_hot_a

way_2_hot_a

    Newbie

  • Members
  • Pip
  • 4 posts

WingedPanther said:

Are you getting error messages? In what sense is it not working?

There is a huge difference between what you want it to do and what you observe it to be doing.



Well as im not that great with batch i figure its "choppy" code. actually it does not work.. it acts weird.. some times the cmd just closes when i try to test it by unplugging the Ethernet cable. Can help fixing the code? Do you think it should work by what you have observed from the code??
THanks WingedPanther

#6
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
It looks like it's a mess, to me. It strikes me as the sort of thing that could cause google to decide to block your IP, among other things.

My guess is you want it to sit and ping google non-stop. If it receives an error, you want it to reset your connection and then go back into the ping loop. I think the reality is that you won't stay in the loop, and will start connecting/disconnecting yourself non-stop until you unplug the cord, at which things just start failing.

The real question is: why does it periodically lose the connection and what is a correct way to monitor/fix the connection?
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#7
way_2_hot_a

way_2_hot_a

    Newbie

  • Members
  • Pip
  • 4 posts

WingedPanther said:

It looks like it's a mess, to me. It strikes me as the sort of thing that could cause google to decide to block your IP, among other things.

My guess is you want it to sit and ping google non-stop. If it receives an error, you want it to reset your connection and then go back into the ping loop. I think the reality is that you won't stay in the loop, and will start connecting/disconnecting yourself non-stop until you unplug the cord, at which things just start failing.

The real question is: why does it periodically lose the connection and what is a correct way to monitor/fix the connection?


Well i it drops the connection because the line over here In the Philippines.. "where i study" is so choppy. unreliable connection from my service provider.. Iv called there technical and lots of other people are having the same problem.. So i don't see how it could be "properly" fixed. I don't really see the problem about pining google, its just a ping. getting back to the point, about the batch file. That or unless anyone here knows of a program that would do this.