Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一个小程序的帮助,我只想启动一个 CMD,然后运行如下命令:dir
dir
所以我做了以下事情:
Process.Start("cmd", "dir");
问题是,这dir不是在 cmd 中执行的。
我怎样才能做到这一点?
尝试
Process.Start("cmd", "/c dir");
或者
Process.Start("cmd", "/k dir");
保持命令窗口打开。