1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
objShell.Run "runas / & log_user & / & passwd & %comspec% /c netsh interface ip show config | find /c ""Oui""> C:\TEMP\netsh.txt"
Wscript.Sleep 3000
Set dhcp_file = objFSO.OpenTextFile("C:\TEMP\netsh.txt", 1)
Do Until dhcp_file.AtEndOfStream
etat_dhcp = dhcp_file.ReadLine
Loop
If etat_dhcp = 1 Then
MsgBox "IP déjà en Dhcp"
Else
objShell.Run "runas / & log_user & / & passwd & %comspec% /c netsh interface ip set address name= ""Connexion au réseau local"" dhcp"
Wscript.Sleep 7000
objShell.Run "runas / & log_user & / & passwd & %comspec% /c netsh interface ip set dns name= ""Connexion au réseau local"" dhcp"
MsgBox "IP statique passé en Dhcp"
End If
WScript.Quit |
Partager