运行命令的vb.net问题

时间:2009-04-25 08:41:16

标签: 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)

任何建议都将不胜感激

1 个答案:

答案 0 :(得分:2)

放一个空格“cmd.exe / c”应为“cmd.exe / c”