与Process.Start和dfsdiag.exe的奇怪行为

问题描述:

DfsDiag.exe默认位于C:\windows\system32。我试图用Process.Start来启动一个进程,但我似乎总是得到错误The system cannot find the file specified。 到目前为止,我似乎没有任何问题。与Process.Start和dfsdiag.exe的奇怪行为

我想...

  • 指定的完整路径@"C:\Windows\System32\DfsDiag.exe"
  • 将文件复制到运行目录。

前者失败,后者工作。我无法为我的生活找出原因。

(操作系统是Windows Server标准2008 R2)

+3

32位应用程序?你已经不习惯文件系统重定向了。尝试'C:\ Windows \ SysNative'。 – 2011-12-21 07:25:00

+2

**不要硬编码到系统文件夹的路径。**不仅好的做法不这样做,它也可以解决像这样的问题。 – 2011-12-21 09:18:23

+0

@RogerLipscombe:啊!它是在64位平台上运行的32位应用程序!为什么不提交你的评论作为答案。 – Ablue 2011-12-22 00:56:38

32位应用程序?你已经不习惯文件系统重定向了。尝试C:\ Windows \ SysNative。