JDownloader Community - Appwork GmbH
 

Reply
 
Thread Tools Display Modes
  #1  
Old 27.06.2011, 13:20
psychic
Guest
 
Posts: n/a
Question Script working outside JDownloader but not as External

Hello, I have a Thomson TG784 and I'm trying to reconnect my internet through JDownloader.

I was able to find a script for it (.vbs), and it works just fine.
When I double click it, it accesses "telnet", put the necessary info automatically and gives me a new IP. But if I add it as External in the reconnection option inside JDownloader and try to run, it doesn´t work.

I got this message (cmd.exe window):

Quote:
C:\Users\(location of the script)> telnet 192.168.1.254
telnet is not recognized as an internal or external command operable program or batch file
.....................
.....................
But, since I have telnet installed, I don't understand why I'm having that error. Because as I said, the script works just fine when I double click it, so telnet is working...

I would like someone here to help me make it work on JDownloader so that when it's necessary to restart my connection, the program can do it automatically.

Last edited by psychic; 27.06.2011 at 13:24.
Reply With Quote
  #2  
Old 28.06.2011, 10:08
remi
Guest
 
Posts: n/a
Cool

Do you understand the meaning of the fields in the External tab of the Reconnection settings?

The Command is for the command you use to launch your script. Specify the full path and the file name of your script.

The Parameter field should contain all parameters for the command you specified for the Command field. You probably don't need any.

If it still doesn't work after this explanation, please provide a screen shot of that External reconnection pane and the script you're using.

Last edited by remi; 29.06.2011 at 12:34. Reason: typo
Reply With Quote
  #3  
Old 28.06.2011, 18:58
psychic
Guest
 
Posts: n/a
Default

Yes, I know that, thanks. On the Command field I placed the path of my script and on the Parameter field I dind't place anything, because the script works by just opening it.

Ok, here is a shot when I try to run it with JDownloader:
http://img18.imageshack.us/img18/4649/32566389.png

And here is a shot when I open my script from its folder (the way it's supposted to work):
http://img31.imageshack.us/img31/2298/84173603.png

Script(this is the only way I can restart the connection with this router):
Quote:
Set oShell = CreateObject("WScript.Shell")
oShell.run "cmd.exe"
WScript.Sleep 500
oShell.SendKeys "telnet 192.168.1.254"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "sumeo"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "sumeo"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "ppp"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "ifdetach"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "Internet"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "ifattach"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "Internet"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "% "

oShell.SendKeys "exit"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "exit"
oShell.SendKeys ("{Enter}")

I really don't understand why the script doesn't work when JDownloader uses it...

Last edited by psychic; 28.06.2011 at 19:17.
Reply With Quote
  #4  
Old 29.06.2011, 12:55
remi
Guest
 
Posts: n/a
Default

This is a bizarre problem knowing that the script works but not the telnet command. The script creates a shell and then sends some telnet commands to the router by simulating keyboard input. A pure script with some telnet commands should work and no VBS nor an additional shell would be necessary. Let's first try some other things.

If you type 'telnet' in a command window and Windoze doesn't recognise the command, then there might be a problem with the "PATH" system variable or telnet is not installed. It seems that telnet is not installed by default in Windoze Vista nor W7. Please read "Can't find Telnet in Vista?" ("**External links are only visible to Support Staff**).

Did you already try to disable the option "Use special executer for windows"?
Reply With Quote
  #5  
Old 29.06.2011, 15:07
psychic
Guest
 
Posts: n/a
Default

I found the script integrated with VBS, so that's what I tried in JDownloader, I don´t know how to use it without VBScript.
And when I need to restart the connection for a new IP I just have to open it, and it's done, so I thought I just had to add it on the external feature...

Telnet is installed, because when I type "telnet 192.168.1.254" on cmd, it works, and I already tried some test command to see if it's working properly, and it is.
Yes, I already tried to disable the option "Use special executer for windows" and the cmd window doesn't even show up.

Maybe this "kind" of script is just not compatible to JDownloader... But I noticed that if I add a text file into the path field, JDownloader opens the file...so why does it open the .vbs script but it doesn't work? I also open the .vbs (with double click) and it starts rebooting the connection so...

By the way, thanks for trying to help me.
Reply With Quote
  #6  
Old 30.06.2011, 11:39
remi
Guest
 
Posts: n/a
Default

What happens if you use the absolute path to your telnet.exe file in the VB script?
Reply With Quote
  #7  
Old 01.07.2011, 16:44
psychic
Guest
 
Posts: n/a
Default

I didn't quite understand.
I place my .vbs file with the script above inside, in the path.

"C:\Users\......\Documents\JDownloader\restart.vbs"
Inside that file is the script, and telnet should open but it doesn't...

Is there anything special when we talk about ABSOLUTE path? Maybe I must place something different than: "C:\Users\......\Documents\JDownloader\restart.vbs"
Reply With Quote
  #8  
Old 02.07.2011, 09:43
remi
Guest
 
Posts: n/a
Default

You need to find the absolute path of your telnet executable file. Replace the telnet command in the .vbs file by the complete path.

Here the complete path is "C:\WINDOWS\system32\telnet.exe".
Reply With Quote
  #9  
Old 02.07.2011, 15:15
psychic
Guest
 
Posts: n/a
Default

I did that, but now I have an error when JDownloader trys to open it.
But it works when I double click the script...

It's something like this:

Windows Script Host
Script: C:\Users\..............\restart.vbs
Line: 2
Char: 1
Error: The system unable to find specified file.
Code: 80070002
Origin: (null)

Maybe I have to change something:
Quote:
Set oShell = CreateObject("WScript.Shell")
oShell.run "C:\WINDOWS\system32\telnet.exe"
WScript.Sleep 500
oShell.SendKeys "Open 192.168.1.254"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "sumeo"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "sumeo"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "ppp"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "ifdetach"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "Internet"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "ifattach"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500

oShell.SendKeys "Internet"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "% "

oShell.SendKeys "exit"
oShell.SendKeys ("{Enter}")
WScript.Sleep 500
oShell.SendKeys "exit"
oShell.SendKeys ("{Enter}")
P.S.: I tried disabling "Use special executer for windows", and nothing happened.

Last edited by psychic; 02.07.2011 at 15:31.
Reply With Quote
  #10  
Old 03.07.2011, 11:36
remi
Guest
 
Posts: n/a
Default

Try replacing

Code:
oShell.SendKeys "telnet 192.168.1.254"
from the first version into

Code:
oShell.SendKeys "C:\WINDOWS\system32\telnet.exe 192.168.1.254"
Reply With Quote
  #11  
Old 03.07.2011, 15:50
psychic
Guest
 
Posts: n/a
Default

I did that and it works by opening it, but if I add it as external I have the same error as before:
Quote:
C:\Users\(location of the script)> telnet 192.168.1.254
telnet is not recognized as an internal or external command operable program or batch file
.....................
.....................
Thanks a lot for trying to help me remi, but it looks like JDownloader can´t deal with this kind of script.
Since it's the only way I know for rebooting my router I'll just have to use it manually...
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 03:42.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Powered by vBulletin® Version 3.8.10 Beta 1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.