0
我正在計算機上運行一些命令,我希望它們輸出一個單獨的文本文件,如果命令無法運行。閱讀控制檯輸出寫出錯誤日誌VB
For Each strUserName As String In strLines
Dim ReplaceCommand As String = sCommand.Replace("*", strUserName).Replace("$$$", saveFileDialog3.FileName & ".txt").Replace("###", exeSearch)
Shell("cmd.exe /c" & ReplaceCommand, AppWinStyle.Hide, True,)
' If Command Cannot Execute, List Why and Move onto Next Command
Using swrr As New StreamWriter(File.Open(ErrorLog, FileMode.OpenOrCreate))
If Console.Readline = "blahblah" Then swrr.WriteLine("FAIL") Else swrr.WriteLine("PASS")
End Using
Next
我在正確的軌道上嗎?我得到一個輸出到一個文本文件,但它只是一行ans總是說PASS。