c# 命令行执行cd 文件夹错误
ProcessStartInfo start; Process p; string sOutput = ""; public Form1() { InitializeComponent(); start = new ProcessStartInfo("cmd.exe");//设置运行的命令行 start.CreateNoWindow = true;//不显示dos命令行窗口 start.RedirectStandardOutput = true;// start.RedirectStandardInput = true;// start.UseShellExecute = false;//是否指定操作系统外壳进程启动程序 p = Process.Start(start); } private void button1_Click(object sender, EventArgs e) { //向CMD窗口发送输入信息: p.StandardInput.WriteLine("cd.."); p.StandardInput.WriteLine("cd.."); p.StandardInput.WriteLine("cd c:尀尀"); p.StandardInput.WriteLine(@"cd c:尀"); p.StandardInput.WriteLine("cd c:尀尀PICT"); p.StandardInput.WriteLine("exit"); //获取CMD窗口的输出信息: sOutput = p.StandardOutput.ReadToEnd(); tbResult.AppendText(sOutput); }cd..还能退文件夹,但进入c盘或指定文件夹就不行了不知道怎么回事。。。