我需要一个代码来键入和执行在cygwin终端的隐藏模式(后台)使用visual basic的命令,我使用的是cmd,但现在我想使用linux源代码,所以我必须使用Linux。我在隐藏模式下成功地运行了cmd,但它不能与cygwin一起工作,下面是cmd代码:
Shell("cmd.exe /k tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt & exit", AppWinStyle.Hide, True)
所以我试过了
Shell(""C:\cygwin\Cygwin.bat -k tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt & exit", AppWinStyle.Hide, True)
和
Shell("C:\cygwin\Cygwin.bat") 'SendKeys.Send("tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt"))
但这仍然不起作用,在第二段代码中,我仍然需要在cygwin中按enter键来处理traceroute,并且它应该是自动处理的,所以我希望我能在这里找到帮助。
发布于 2012-04-22 17:35:49
Shell("C:\cygwin\Cygwin.bat")
SendKeys.Send("tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt"))
SendKeys.Send("{ENTER}")这就是答案,icase任何人都需要它。
https://stackoverflow.com/questions/10262518
复制相似问题