【发布时间】:2011-01-14 01:34:46
【问题描述】:
ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd", "/c " +"processNeedToRun")
{
RedirectStandardError = true,
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true,
Verb ="runas"
};
我使用上面的代码在C#中通过cmd运行一个进程。
但是,问题是:
- “processNeedToRun”在运行时需要参数。
- 即使我设置 Verb ="runas",Windows 7 仍然会提示一个提升对话框。
是否可以满足所有要求?
【问题讨论】:
标签: c# .net process privileges