Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

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

Пользователь


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

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


вот вроде рабочий вариант

Код: Выделить весь код
Func _power($value)
	
	local $PowerShell = Run(@ComSpec & " /c " &$value, @SystemDir, @SW_HIDE , $STDERR_MERGED + $STDIN_CHILD)       
	local $out="", $err=""
	StdinWrite($PowerShell)
	While 1
		$line = StdoutRead($PowerShell)
		
		If @error Then ExitLoop
		If $line <> "" Then
		$out&=_StringOEM2ANSI($line)
		EndIf
	Wend
	

	if $out="" then
		$out=""
		While 1
			$err = StderrRead($PowerShell)
			If @error Then ExitLoop
			If $line <> "" Then
				$out&=_StringOEM2ANSI($err)
			EndIf

		Wend	
	endif	
	
	If $PowerShell Then ProcessClose($PowerShell)
	if $out <> "" then Return $out

EndFunc

Отправлено: 13:25, 21-12-2009 | #10