2012-04-21 60 views
0

我需要一个代码来在隐藏模式(背景)中使用visual basic在cygwin终端中输入和执行命令,我使用的是cmd,但现在我想使用Linux源代码,所以我必须使用linux。 我跑在隐藏模式在cmd成功,但它不与Cygwin的工作,这里是CMD代码:
Shell("cmd.exe /k tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt & exit", AppWinStyle.Hide, True)运行cygwin终端使用vb

,所以我试图

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中的输入到pr请使用traceroute,并且应该自动进行处理,所以我希望我能在这里找到帮助。

回答

1
Shell("C:\cygwin\Cygwin.bat") 

SendKeys.Send("tracert -h " & _h & " " & domain.Text & " > temp" & i + 1 & ".txt")) 

SendKeys.Send("{ENTER}") 

这就是答案,icase任何人都需要这个。

+0

thx,非常有义务:) – mschr 2014-01-17 19:04:43