Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6176325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:04:55+00:00 2026-05-24T00:04:55+00:00

I have a pre build event set up to generate the version/build number to

  • 0

I have a pre build event set up to generate the version/build number to embed in my exe. The event consists of a call to a batch file that does the actual work (a parameter is passed to the batch file). The batch file works as it should on all of the computers I’ve tried it on, including the Windows XP computers. It also runs fine as a pre build event on the 3 computers here running windows 7. The pre build event fails, however, on Windows XP. Delphi returns an error code that I can’t seem to find a reference to anywhere, “20018”.

I’ve tried a number variations to the way I call the batch file without any luck. Does anyone have an idea what’s happening?

The build event is as follows:

call "..\..\Build Tools\PreBuild.bat" "$(PROJECTDIR)"

UPDATE:
I’ve removed the source of the batch file, since it had no relevance for the actual problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:04:56+00:00Added an answer on May 24, 2026 at 12:04 am

    Ok, I finally found the answer here:
    http://delphi.about.com/od/devutilities/a/pre_post_build.htm

    The problem was spaces in the path to the batch file being called. Apparently this isn’t a problem in Windows 7.

    Removing the space in the build tools directory and changing the pre build event to the following fixed the problem:

    call ..\..\BuildTools\PreBuild.bat "$(PROJECTDIR)"
    

    Here’s the important bit from the link:

    Command Line: This is the trickiest of them all, but after you get one working, they’re all easy. The trick here is not to use quotes on the program’s name but instead use the windows SFN (Short File Name). The reason is that, should you need to use quotes to enclose the path of your file, the IDE gets confused with too many quotes. So, these are the wrong ways of adding that command line above:

    C:\Program Files\SoftwarePassport\Armadillo.exe D:\Dev\My Prog\Prot.arm /P

    “C:\Program Files\SoftwarePassport\Armadillo.exe” D:\Dev\My Prog\Prot.arm /P

    C:\Program Files\SoftwarePassport\Armadillo.exe “D:\Dev\My Prog\Prot.arm” /P

    “C:\Program Files\SoftwarePassport\Armadillo.exe” “D:\Dev\My Prog\Prot.arm” /P

    This last one should work, if it were not for the IDE to be confused with it. So, what does work is either of these:
    C:\Progra~1\Softwa~1\Armadillo.exe “D:\Dev\My Prog\Prot.arm” /P

    C:\Progra~1\SoftwarePassport\Armadillo.exe “D:\Dev\My Prog\Prot.arm” /P

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an exe file as a part of pre build event. I
I have a vcproj file that includes a simple pre-build event along the lines
We have multiple config files (app.DEV.config, app.TEST.config, etc) and a pre-build event that copies
I have a custom tool which is set up as a pre-build event, it
I have a project that comprises pre-build Dll modules, built some time in the
I have just written a small utility to be used in a pre-build event.
I have a pre-build event on a C# project which runs xsltproc to transform
I have a pre tag within my page that contains quite a bit of
I have a pre-made SQLite database that I am downloading from the net via
I have a projet in c# .net. I need to hook the pre build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.