Author Topic: restart router batch script thigie  (Read 40395 times)

restart router batch script thigie
on: December 03, 2012, 12:02:31 PM
sick of having to get off my ass to go hard reset my router...

and even worse trying to remote from home to work and vice versa only to find the router on the other end has crashed so can't remote in at all

so I tried to write a batch script to telnet into the local router and restart it each day.... but... a windows telnet won't accept passwords and the batch file can't send them once it's running (spent 2 hours thinking it was just me doing it wrong)

found a small program which can work with telnet to do the username pass wtc...
it needs a batch file to run the program, and point it to a text file with a list of commands in it to run

dropbox link to my version

Code: (to run program/text file) [Select]
tst10.exe /r:reboot.txt /m
Code: (text file) [Select]
192.168.1.254
WAIT "Username :"
SEND "Administrator\m"
WAIT "Password :"
SEND "PASSWORD\m"
SEND "system reboot\m"
WAIT "#"
SEND "exit\m"

swap PASSWORD for your password

might need a slight edit to work with your router... I just telnet into mine to play around and figure out what it needed

then it runs at 4am every morning via windows scheduled tasks


have been meaning to do something like this for ages but just never got around to it.... figure it might be handy for some other people too

handy to stick a shortcut onto the desktop of any noob friends/family so they can restart there router easy with a double click :-)
Last Edit: December 03, 2012, 13:53:38 PM by knighty #187;

    • Tekforums.net - It's new and improved!
  • Offline Clock'd 0Ne

  • Clockedtastic
  • Posts: 10,947
  • Administrator
  • Hero Member
Re: restart router batch script thigie
Reply #1 on: December 03, 2012, 13:51:09 PM
That's fantastic, I will give it a go with mine as it suffers from prolonged use without a reboot :)

Re: restart router batch script thigie
Reply #2 on: December 03, 2012, 18:59:04 PM
For scheduled reboots, I believe if you have dd-wrt it will do this out of the box, but good to see something you can run from a batch file!

Re: restart router batch script thigie
Reply #3 on: December 03, 2012, 22:48:49 PM
Real routers cost money son.

I can't remember the last time I had to touch my Draytek router.  That's with a fibre connection and passing hundreds of GB through it a month.

Re: restart router batch script thigie
Reply #4 on: December 03, 2012, 23:16:52 PM
Real routers cost money son.
I can't remember the last time I had to touch my Draytek router.  That's with a fibre connection and passing hundreds of GB through it a month.

I had a £250 cisco

couldn;t get the bloody thing to work, all settings had to be via telnet, and there was no basic/default settings.... you had to set every setting individually... like turn on each lan port individually, then give them each an ip address, then setup each one for what it's allowed to connect to etc...

drove me crazy

got sick of it and ebayed it in the end


current pos is alright for weeks if I take it easy.... but I tend to hammer it :-)

Re: restart router batch script thigie
Reply #5 on: December 03, 2012, 23:25:30 PM
I've got a cheepie buffalo router with DD-WRT and it's rock solid, you don't have to spend a lot of money to get a good router ;)

restart router batch script thigie
Reply #6 on: December 03, 2012, 23:53:44 PM
Reminds me of expect. Used that tons on Linux systems. :)


Re: restart router batch script thigie
Reply #8 on: December 04, 2012, 21:14:40 PM
Not sure on that tbh, the buffalo was a fraction of the cost and doesn't have any problems on a 30meg connection although the buffalo isn't 802.11n, not saying that the draytek isn't a good router, but mine has no problems  8)

Re: restart router batch script thigie
Reply #9 on: December 05, 2012, 11:27:40 AM
well.... the batch file works perfectly when I run it manually...

but I can't get windows task scheduler to run it automatically

I think/guess my pc is in sleep mode at 4am when I set it to run... even tho I set task scheduler to wake it up....


I'll check the cctv system at work later, that never goes to sleep ;)

Re: restart router batch script thigie
Reply #10 on: December 05, 2012, 19:40:08 PM
Real routers cost money son.

I can't remember the last time I had to touch my Draytek router.  That's with a fibre connection and passing hundreds of GB through it a month.

Are draytek's good ones? I always thought they where budget which is annoying because when I refurb marstons pubs they always have the Vigor 2710 laying around and I have chucked quite a few on the skips in the past  :-\

I've not had any probs with my Sky sagem one yet.

Re: restart router batch script thigie
Reply #11 on: December 05, 2012, 20:55:37 PM
Fantastic routers tbh. It's generally all we fit at work. Fit and forget, and on the rate occasion that they do go wrong, draytek support is second to none.

Sent from my GT-I9300 using Tapatalk 2


Re: restart router batch script thigie
Reply #12 on: December 06, 2012, 07:38:39 AM
Fantastic routers tbh. It's generally all we fit at work. Fit and forget, and on the rate occasion that they do go wrong, draytek support is second to none.

Sent from my GT-I9300 using Tapatalk 2
cool next time I'm in a shut down pub I'll swipe one, must have thrown dozens of them away in the past, gutted.

Re: restart router batch script thigie
Reply #13 on: December 07, 2012, 18:21:33 PM
well... I can't get the bloody thing to work via task scheduler

any ideas anyone ?

it runs fine if I double click the batch file... but task scheduler won;t do anything, even if I right click / run to make it run on demand :-(

Re: restart router batch script thigie
Reply #14 on: December 07, 2012, 18:24:43 PM
Have you set it to run as Administrator and set the Admin password?

Are you also getting an error code in task scheduler?, maybe an 0x code?

0 Members and 1 Guest are viewing this topic.