谢谢502762378兄的指导,正则确实有点复杂,但使用stringsplit效果也不错可满足要求,代码修改为:Local $test_PC = "PC1"
Local $log = "c:\logonuser.txt"
Local $cmd = "c:\psloggedon.exe \\" & $test_PC & " >" & $log
RunWait(@ComSpec & " /c " & $cmd,"", @SW_HIDE)
Local $file = FileOpen($log,0)
$logonuserinfo = FileReadline($file,8)
$logonuser = StringSplit($logonuserinfo, ' ')
MsgBox("","",$logonuserinfo)
MsgBox("","",$logonuser)
FileClose($file)
fileDelete($log)
再次感谢!
页:
1
[2]