Bonjour a tous.
je suis un novice en dévellopement et j'ai un soucis.

Je cherche a faire un VBS qui me permettrait de ping www.google.fr et si le test echoue. je souhaiterai que celui-ci se connecte en auto a mon routeur pour faire un redémarrage de celui-ci.

J'aurais besoin d'un coup de pouce.

Voila ou j'en suis :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Dim shell, args, params, fso, fa,fs 
Set shell = WScript.CreateObject("WScript.Shell") 
Set fso = WScript.CreateObject("Scripting.FileSystemObject") 
Set args = Wscript.Arguments 
Script=Lcase(Wscript.ScriptFullName) 
set fs=fso.GetFile(Script) 
sps=lcase(fs.ShortPath)
 
 
if ping = 0 then
	shell.Run "telnet 192.168.0.1"
	wscript.sleep 500 
	Shell.SendKeys "admin" & chr(13)
	WScript.Sleep 500
	Shell.SendKeys "passwd:" & chr(13)
	WScript.Sleep 500
	Shell.SendKeys "reboot" & chr(13)
	WScript.Sleep 1
	Shell.SendKeys "Logout" & chr(13)
	WScript.Sleep 1
	Shell.SendKeys "quit" &  chr(13) & chr(13)
	WScript.Sleep 1
	Shell.SendKeys "exit" & chr(13)
else
	Shell.SendKeys "exit" & chr(13)
end if
 
 
PING = Shell.Run("Ping.exe 192.168.0.1", 0,TRUE)
Msgbox "Resultat du PING " & PING
 
exit