help creating batch file

ezkim0x

Senior member
Nov 25, 2004
320
0
0
I'm new to batch files.. and trying to write one to automate changing my ip. can you help me out? .. here's the source:

<TR>
<TD align=CENTER valign=MIDDLE><INPUT TYPE=BUTTON onclick="RebootDevice();" class=button VALUE=" OK "></INPUT></TD>
<TD align=CENTER valign=MIDDLE><IMG border=0 src="empty.gif" name="empty" width="5" height="28"></TD>
<TD align=CENTER valign=MIDDLE><INPUT TYPE=BUTTON onclick="window.top.location.href='advanced_menu.htm'" class=button VALUE=" Cancel "></INPUT></TD>
<TD align=CENTER valign=MIDDLE><IMG border=0 src="empty.gif" name="empty" width="5" height="28"></TD>
</TR>

...here's what I tried:

@echo off
wget -q --user=admin --password=password \ --post-data=submit=OK -O nul \ http://192.168.1.1/restart.htm

I have wget in the same folder as the bat file.. the verizon modem/router model number is: 327w

can anybody help me out? I'd really appreciate it.
 

degibson

Golden Member
Mar 21, 2008
1,389
0
0
What happens when you run the batch file? Is there an error of some kind...? What happens if you run wget directly from the command line?
 

ezkim0x

Senior member
Nov 25, 2004
320
0
0
doesn't show an error or anything.. just opens waits a bit and then closes out.

i put wget.exe in system32 folder.. opened cmd prompt and..

C:\Documents and Settings\Administrator>wget -q --user=admin --password=password
--post-data=submit=OK -O nul \ http://192.168.1.1/restart.htm

C:\Documents and Settings\Administrator>

it did that .. said the command at the top of the cmd line for a little bit.. took about 5 seconds to goto the next line.. but nothing happened. is there a way to start some type of debug file with wget?
 

Drakkon

Diamond Member
Aug 14, 2001
8,401
1
0
try a "-d -o logfilename" on the wget command line (change logfilename to something you can use)
 

ezkim0x

Senior member
Nov 25, 2004
320
0
0
here's what I get in the logfile when running from cmd line

DEBUG output created by Wget 1.10.2 on Windows.

seconds 0.00, seconds 0.00, seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932
seconds 0.00, Created socket 1932.
Releasing 0x009259a0 (new refcount 0).
Deleting unused 0x009259a0.

---request begin---
POST /restart.htm HTTP/1.0

User-Agent: Wget/1.10.2

Accept: */*

Authorization: Basic YWRtaW46YWRtaW4=

Host: 192.168.1.1

Connection: Keep-Alive

Content-Type: application/x-www-form-urlencoded

Content-Length: 9



---request end---
[POST data: submit=OK]
Closed fd 1932