RunCMD() v0.94 : Capture stdout to variable. Non-blocking version. Pre-process/omit individual lines.

Post your working scripts, libraries and tools
User avatar
SKAN
Posts: 853
Joined: 29 Sep 2013, 16:58

Re: RunCMD() v0.94 : Capture stdout to variable. Non-blocking version. Pre-process/omit individual lines.

21 Nov 2020, 09:41

burque505 wrote:
20 Nov 2020, 09:03
@william_ahk, try this code. There's apparently a carriage return in the stdout from 'echo'.

Code: Select all

#Include RunCmd.ahk

str1 := RunCMD(A_ComSpec . " /c echo SKAN")
str1 := RegExReplace(str1, "`r`n")
msgbox % str1
If (str1 == "SKAN") 
	msgbox Equal
else
	msgbox %str1% Is Not Equal to SKAN
Regards, burque505


Thanks @burque505

We may also use RTrim()

:thumbup:

Return to “Scripts and Functions”

Who is online

Users browsing this forum: necomerx and 16 guests