none
How to return failure from postlink.bat RRS feed

  • Question

  • Hi,

    I am copying certain files in postlink.bat in a subproject (Windows Embedded Compact 7), but want to be able to stop the build if the copy fails.

    Is there a way to return a failure to whatever calls this batch file? E.g if the copy fails, failure is returned and the build stops.

    Thanks,
    Samie

    Thursday, October 8, 2015 8:23 AM

All replies

  • I suspect that there is no way, but I am basing that on assuming that you have already run into the problem and that build didn't stop.

    But maybe we should look at this differently, how can we prevent the error in the first place?  Why would the copy fail, and is there anything that can be done differently in your postlink.bat?

    If the link failed then the postlink.bat shouldn't run and the build should stop - so I assume that isn't the failure case.

    That leaves a few possibilities:

    1. The disk is write protected, if this is possible, then not much we can do...
    2. The destination folder is read-only, if this is possible, the check the attributes and change them before doing the copy
    3. The destination already contains the file, check for this and delete the file first



    Bruce Eitman (eMVP)
    Senior Engineer
    Bruce.Eitman AT Eurotech DOT com
    My BLOG http://geekswithblogs.net/bruceeitman
    I work for Eurotech

    Thursday, October 8, 2015 6:18 PM
    Moderator