Trouver son adresse ip tout simplement !

Contenu du snippet

kliké dessus et regardez votre ip

Source / Exemple :


Option Explicit
 
Dim WshShell,obj,Command,Result,Temp,FileName,File
Set obj = WScript.CreateObject("Scripting.FileSystemObject")
Set WshShell=WScript.CreateObject("WScript.Shell")
FileName=GetTempFile("command.txt")

Result = Ping()
 
Function Ping()

    Command = "%COMSPEC% /C ipconfig.exe > %TEMP%\command.txt"
    Result = WshShell.Run(Command,0,True)
    Temp = obj.GetSpecialFolder(2).Path
    Set File = obj.OpenTextFile(FileName)
    Ping = file.ReadAll
    file.Close
    obj.DeleteFile FileName,True

End Function
 
Function GetTempFile(File)
GetTempFile=WshShell.ExpandEnvironmentStrings("%TEMP%") & "\" & File
End Function

MsgBox(Result)

A voir également