两文件放在同目录下可测试
1.bat内容:@echo off
set station_id=1A
set operatorid=F2720532
echo %station_id%
echo %operatorid%
test.au3:$val = StringSplit (getval (),"||",1)
If FileExists ("1.txt") Then FileDelete ("1.txt")
FileWriteLine("1.txt",$val[1]&"="&$val[2])
ShellExecute ("1.txt")
Func getval ()
Local $foo,$line,$temp=""
$foo = Run('1.bat', '', @SW_HIDE,0x2)
While 1
$line = StdoutRead($foo)
If @error Then ExitLoop
If $line <> "" Then
$line = StringRegExpReplace ($line,"\s","|")
$temp &= $line
EndIf
WEnd
Return $temp
EndFunc
|