Skip to content

Instantly share code, notes, and snippets.

@masaru-b-cl
Created March 24, 2014 01:32
Show Gist options
  • Save masaru-b-cl/9732686 to your computer and use it in GitHub Desktop.
Save masaru-b-cl/9732686 to your computer and use it in GitHub Desktop.
execute FxCop from command line bat file.
@rem quoted path to FxCopCmd.exe.
set FXCOP_PATH="%ProgramFiles%\Microsoft Fxcop 10.0\FxCopCmd.exe"
@rem path to "FxCop Project File" that created by FxCop GUI (FxCop.exe).
set FXCOP_PROJ=MyProj.FxCop
@rem path to FxCop report file.
set FXCOP_REPORT=FxCopReport.xml
cd "%~d0%~p0"
del %FXCOP_REPORT%
%FXCOP_PATH% /p:%FXCOP_PROJ% /out:%FXCOP_REPORT%
@rem set return code if FxCop succeeded 0 else -1.
@rem (FxCop generate report file only SUCCESS.)
if exist %FXCOP_REPORT% (exit -1) else (exit 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment