Created
April 19, 2012 10:48
-
-
Save fushnisoft/2420211 to your computer and use it in GitHub Desktop.
Example pre-build script for cancelling build if exe file is already open
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ECHO off | |
:delfile | |
del %1% | |
if exist %1% goto fail | |
goto end | |
:fail | |
ECHO Unable to delete %1%, you probably still have it open! | |
EXIT /B 1 | |
:end | |
:: Put this bat file in your pre-build event to cancel the build if the file is already open | |
:: Call like this: del.bat MyProgram.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment