Questo codice non ha bisogno di creare il file temporaneo, fa tutto da solo.
codice:Option Explicit Dim WshShell, oExec, regex, matches, match, adapterName Set WshShell = CreateObject("WScript.Shell") Set regex = new RegExp regex.Pattern = "Ethernet\ adapter\ (.*?):" regex.Global = True Set oExec = WshShell.Exec("ipconfig /all") Do While oExec.Status = 0 WScript.Sleep 100 Loop Set matches = regex.Execute(oExec.StdOut.ReadAll()) For Each match In matches adapterName = match.SubMatches(0) 'ora in adapterName è memorizzato il nome dell'adattatore di rete; qui ci fai quello che ci devi fare (in questo esempio, lo mostro all'utente) MsgBox adapterName Next

Rispondi quotando