Attribute VB_Name = "leggi_ipconfig_linea_comando"
'
Option Explicit
'
' vba - Leggi Ipconfig Linea Di Comando
'
'
Sub LeggiIpconfigLineaDiComando()
Sheets.Add
Dim riga
Dim proShell, Linecomando, txtstringa
Set proShell = CreateObject("WScript.Shell")
Set Linecomando = proShell.Exec("%comspec% /c ipconfig.exe /all")
'
Do Until Linecomando.StdOut.AtEndOfStream
txtstringa = Linecomando.StdOut.ReadLine()
riga = riga + 1
txtstringa = Replace(txtstringa, Chr(13), "")
ActiveSheet.Cells(riga, 1).Value = txtstringa
Loop
'
End Sub
Nessun commento:
Posta un commento