0

DfsDiag.exe is located by default in C:\windows\system32. I try to start a process for it with Process.Start but I always seem to get the error The system cannot find the file specified. I don't seem to have the problem with anything else so far.

I tried...

  • Specifying the full path @"C:\Windows\System32\DfsDiag.exe"
  • Copying the file to the running directory.

The former failed while the latter worked. I can't for the life of me work out why.

(OS is Windows Server Standard 2008 R2)

Matt
  • 873
  • 1
  • 9
  • 24
  • 3
    32-bit app? You've fallen foul of filesystem redirection. Try `C:\Windows\SysNative`. – Roger Lipscombe Dec 21 '11 at 07:25
  • 2
    **Never hard-code paths to system folders.** Not only is it good practice not to do so, but it also solves problems like this one. – Cody Gray - on strike Dec 21 '11 at 09:18
  • @RogerLipscombe: Ah! it is a 32bit app running on a 64bit platform! Why not submit your comment as an answer. – Matt Dec 22 '11 at 00:56
  • @RogerLipscombe: Yes, that worked. I will have to remember that one. Please submit as answer so I can close this and award precious internet points. – Matt Dec 22 '11 at 00:58
  • @CodyGray the point is that it didn't work without the path _or_ with it. – Matt Dec 22 '11 at 05:12
  • And on a side note, the fact that the .NET Framework is still not aware of file system redirection after all these years, is really strange. – Strelok Dec 22 '11 at 21:46

1 Answers1

2

32-bit app? You've fallen foul of filesystem redirection. Try C:\Windows\SysNative.

Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380