Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Ветеран


Сообщения: 27449
Благодарности: 8088

Профиль | Отправить PM | Цитировать


Если нужен весь вывод с последующим парсингом — я бы вообще работал с WSH/PoSH, наподобие:
Скрытый текст
Код: Выделить весь код
Option Explicit

Const strPath2smartctl = "%ProgramFiles%\smartmontools\bin\smartctl.exe"

Const WshRunning  = 0
Const WshFinished = 1
Const WshFailed   = 2


Dim strAbsolutePath2smartctl
Dim strOutput


With WScript.CreateObject("WScript.Shell")
	strAbsolutePath2smartctl = .ExpandEnvironmentStrings(strPath2smartctl)
	
	If WScript.CreateObject("Scripting.FileSystemObject").FileExists(strAbsolutePath2smartctl) Then
		With .Exec(strAbsolutePath2smartctl & " -a /dev/sda")
			If .Status <> WshFailed And .Status = WshRunning Then
				strOutput = ""
				
				Do
					strOutput = strOutput & .StdOut.ReadAll()
					
					WScript.Sleep 100
				Loop Until .Status = WshFinished
				
				WScript.Echo strOutput
			Else
				WScript.Echo "Can't execute [" & strAbsolutePath2smartctl & "]."
				WScript.Quit 2
			End If
		End With
	Else
		WScript.Echo "Can't find executive file [" & strAbsolutePath2smartctl & "]."
		WScript.Quit 1
	End If
End With

WScript.Quit 0

И потом парсите полученный в strOutput вывод как душеньке будет угодно, в том числе и регулярками.
Это сообщение посчитали полезным следующие участники:

Отправлено: 19:38, 20-11-2018 | #5