Search the Community
Showing results for tags 'cmdreturn'.
Found 1 result
hello, I'm trying to make a check if a process is running on a remote PC. This is what i got this far when I edit a found snippet on this forum. The function _CMDreturn returns the output of the command line command. In this output I want to scan if there is a line whit "process mspaint was not found". This I'm trying to do whit StringLeft. The problem is that I don't get any error's and also don't get a message if it doesn't exist. Could somebody say to me what I'm doing wrong here? Or iff there is a better way to do this? Thanks in advanced. #include <Constants.au3> $result= _CMDreturn('C:\Tools\Ps\pslist.exe mspaint') msgbox(0,"Version",$result) Func _CMDreturn($sCommand) $cmdreturn = "" $stream = Run(@ComSpec & " /c " & $sCommand, @SystemDir, @SW_HIDE, $STDOUT_CHILD + $STDIN_CHILD) While 1 $line = StdoutRead($stream) If @error Then ExitLoop If StringLeft($line, 32) = "process mspaint was not found on" Then msgbox(0,"not found",$line) EndIf $cmdreturn &= $line WEnd Return $cmdreturn EndFunc