1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Call IpConfig()
Call LireResultat()
Sub IpConfig()
Set Ws = CreateObject("wscript.Shell")
Command = "Cmd /c ipconfig /all > %tmp%\ipconfig.txt"
Resultat = Ws.Run(Command,0,True)
End Sub
Sub LireResultat()
Dim File,Fichier,tempFolder
Set fso = createobject("Scripting.FileSystemObject")
Set Ws = CreateObject("wscript.Shell")
Set tempFolder = fso.GetSpecialFolder(2)
File = tempFolder &"\ipconfig.txt"
Set Fichier = fso.OpenTextFile(File,1)
LireTout = Fichier.ReadAll
MsgBox " Résultat de Ipconfig "&vbcr& LireTout,64,"Adresse IP"
End Sub |
Partager