2009-04-25 197 views
0

以下runapplication將無法正常工作vb.net問題運行命令

Private Sub RunApplication(ByVal ProgName As String) 
     // String of text as a command to execute with the command line interpreter 
     Dim strApplication As String = "cmd.exe/c" 
     Dim ProcessID As Integer 
     strApplication = strApplication & " " & ProgName & " > C:\tool.tmp" 

     // Execute the command but hide it from the user 
     Shell(strApplication, AppWinStyle.Hide, True) 

     // View the Output in notepad.exe 
     ProcessID = Shell("notepad.exe C:\tool.tmp", AppWinStyle.NormalFocus) 
     AppActivate(ProcessID) 

任何建議將是我們所感謝

回答

2

將一個空間「的cmd.exe/c」應爲「CMD.EXE/c「

+0

thanx mate it works – Mark 2009-04-25 09:17:00