26

Where can I find the CorFlags.exe tool? I made full search of my hard disk drive, but it was not found.

I have: .NET Framework 4.0, Visual C# 2010 Express, Visual C++ 2010 Express. The OS is Windows 7 Ultimate 32 bit.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Edward83
  • 6,664
  • 14
  • 74
  • 102

2 Answers2

40

It should be part of the Windows SDK, version 6 or higher, located somewhere like...

%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bin\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\Bin\x64\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\Bin\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\Bin\x64\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v7.1\Bin\x64\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\CorFlags.exe
%ProgramFiles%\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\x64\CorFlags.exe

If you don't see it and you have a 64-bit system, also check %ProgramFiles(x86)%.

user541686
  • 205,094
  • 128
  • 528
  • 886
  • 1
    It could also be under the x86 folder if the 32bit Windows SDK installer used: `C:\Program Files (x86)\Microsoft SDKs\Windows`. Also, each version of the SDK has different versions of `CorFlags.exe`, which produce slightly different output. – Eric Lease Mar 31 '16 at 18:20
  • Most could probably find it on their own from the information provided, but in newer versions of the Windows SDK install, the path below `bin` will include the .NET framework version, such as `...\v8.0A\bin\NETFX 4.0 Tools`, `...\v10.0A\bin\NETFX 4.6 Tools`, or `...\v10.0A\bin\NETFX 4.6.1 Tools` – Eric Lease Mar 31 '16 at 19:17
  • 1
    It seems that the Windows SDK now is called "[**.NET Framework Dev Pack**](https://www.microsoft.com/net/download)". Here is the [download link to the currently latest Dev Pack 4.7.2](https://www.microsoft.com/net/download/thank-you/net472-developer-pack). After installing, it was located at "`C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools`", even on my 64 bit Windows 10 machine. – Uwe Keim Aug 29 '18 at 10:59
1

If you want to find it in Visual Studio Developer CMD and have Python, use this script (my original work):

import os
def selectlower(w):
    d = []
    for i in w:
        d.append(i.lower())
    return d
def searchmyPATH(name):
    e = True
    pathenv = os.environ['PATH']
    paths = pathenv.split(';')
    for x in paths:
        if os.path.exists(x) and os.path.isdir(x):
            y = selectlower(os.listdir(x))
            if name.lower() in y:
                print(x)
                e = False
    if e:
        print("none")
searchmyPATH("corflags.exe")

With my 64-bit Windows 10 machine, I found it in C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools as an example. (I was actually looking for ResGen.)
Run the Python script in VS Developer CMD.