rogntudjuuuuuuuuu a écrit :
un ptit truc en vbs. Tu ouvre un fichier texte, tu copie le code suivant, tu enregistre au format vbs, et tu double clique
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)
voila voilou
|