In C# WPF: I want to execute a CMD command, how exactly can I execute a cmd command programmatically?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can use this to work cmd in C#:
Don't forget to write /c before your argument !!
In addition to the answers above, you could use a small extension method:
and use it like so:
Argh :D not the fastest
Are you asking how to bring up a command windows? If so, you can use the Process object ...
Using Process.Start:
How about you creat a batch file with the command you want, and call it with Process.Start
dir.bat content:
then call:
Will call the bat file and execute the dir