JDownloader Community - Appwork GmbH
 

Respuesta
 
Herramientas Desplegado
  #1  
Antiguo 27-Jun-2011, 13:20
psychic
Guest
 
Mensajes: 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):

Cita:
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.

Última edición por psychic; 27-Jun-2011 a las 13:24
Responder Citando
  #2  
Antiguo 28-Jun-2011, 10:08
remi
Guest
 
Mensajes: 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.

Última edición por remi; 29-Jun-2011 a las 12:34 Razón: typo
Responder Citando
  #3  
Antiguo 28-Jun-2011, 18:58
psychic
Guest
 
Mensajes: n/a
Predeterminado

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):
Cita:
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...

Última edición por psychic; 28-Jun-2011 a las 19:17
Responder Citando
  #4  
Antiguo 29-Jun-2011, 12:55
remi
Guest
 
Mensajes: n/a
Predeterminado

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"?
Responder Citando
  #5  
Antiguo 29-Jun-2011, 15:07
psychic
Guest
 
Mensajes: n/a
Predeterminado

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.
Responder Citando
  #6  
Antiguo 30-Jun-2011, 11:39
remi
Guest
 
Mensajes: n/a
Predeterminado

What happens if you use the absolute path to your telnet.exe file in the VB script?
Responder Citando
  #7  
Antiguo 01-Jul-2011, 16:44
psychic
Guest
 
Mensajes: n/a
Predeterminado

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"
Responder Citando
  #8  
Antiguo 02-Jul-2011, 09:43
remi
Guest
 
Mensajes: n/a
Predeterminado

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".
Responder Citando
  #9  
Antiguo 02-Jul-2011, 15:15
psychic
Guest
 
Mensajes: n/a
Predeterminado

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:
Cita:
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.

Última edición por psychic; 02-Jul-2011 a las 15:31
Responder Citando
  #10  
Antiguo 03-Jul-2011, 11:36
remi
Guest
 
Mensajes: n/a
Predeterminado

Try replacing

Código:
oShell.SendKeys "telnet 192.168.1.254"
from the first version into

Código:
oShell.SendKeys "C:\WINDOWS\system32\telnet.exe 192.168.1.254"
Responder Citando
  #11  
Antiguo 03-Jul-2011, 15:50
psychic
Guest
 
Mensajes: n/a
Predeterminado

I did that and it works by opening it, but if I add it as external I have the same error as before:
Cita:
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...
Responder Citando
Respuesta

Herramientas
Desplegado

Normas de Publicación
No puedes crear nuevos temas
No puedes responder mensajes
No puedes subir archivos adjuntos
No puedes editar tus mensajes

Los Códigos BB están Activado
Las Caritas están Activado
[IMG] está Activado
El Código HTML está Desactivado

Ir al Foro

La franja horaria es GMT +2. Ahora son las 01:47.
Provided By AppWork GmbH | Privacy | Imprint
Parts of the Design are used from Kirsch designed by Andrew & Austin
Desarrollado por: vBulletin® Versión 3.8.10 Beta 1
Derechos de Autor ©2000 - 2020, Jelsoft Enterprises Ltd.
Traducido por mcloud de vBhispano.com