关于VB.NET中调用CMD执行处理理
现在想做个VB.NET的程序 把批处理命令一行行放到代码里执行 比如 用户点了一下这个按钮 就打开一个CMD窗口显示批处理命令执行的进度 就像网上“清理系统垃圾文件”的BAT一样 把BAT里的代码封装到控件里调用CMD执行 我上网找了下方法 有说用
Dim p As New Process
p.StartInfo.FileName = "cmd.exe "
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardInput = True
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.RedirectStandardError = True
p.StartInfo.CreateNoWindow = True
p.Start()
p.StandardInput.WriteLine("ipconfig /all")
Dim strRst As String = p.StandardOutput.ReadToEnd()
的 但是执行了不显示CMD窗口 并且我不知道执行结果 我以前用VB的时候 可以用print #1,函数把一条条批处理命令封装到按钮里点一下就弹出CMD窗口执行批处理命令 请问在VB.NET里怎么做 我用的开发环境是Visual Studio2008 请各位大大给个方法小弟在线等 最好写出详细的过程和函数 我初学VB的