StampVer: Command line version updater


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame



StampVer was written to allow easy stamping of a build number into the version resource of a Win32 executable. This build number can be specified on the command line, or via a response file. If a response file is used, StampVer can autoincrement the version number contained it it.

This can be useful if you are frequently passing application builds around and want something more definitive than file dates to determine which version someone has.

Note that this works directly on the final EXE - as it does not make changes to your source files, your resources do not need to be recompiled. In other words, it's fast!

Syntax and options

   StampVer [options] <exefile>

  -? displays this message
  -f"" stamp with specified file version number, e.g. -f""
  -p"" stamp with specified product version number, e.g. -p""
  -v"<filename>" get version number from response file, e.g. -v"stampver.inf"
  -i[1|2|3|4] preincrement file version number in response file
               1,2,3,4 correspond to a element of the version number, so
               to increment the minor version, use -i4. Useful for
               auto-incrementing a build number.
  -j[1|2|3|4] preincrement product version number in response file (as above).
  -k keep original file timestamp
  -nopad prevent padding of version strings with spaces.
  -o[1|2|3|4] sets the amount of output produced:
               -o1 errors only
               -o2 show warnings
               -o3 show informational messages
               -o4 show verbose diagnostics
   Quotes around parameters are optional unless the parameter contains spaces.

About StampVer response files

The response file is a simple text file that contains the last version number that was applied. Here is an example:

    ;StampVer information file
    FileFormat=%a.%b.%c Build %04d
    ProductFormat=%a.%b.%c Build %04d

The response file allows you to have separately maintained file and product numbers. If you do not wish to stamp either the file or product number, then simply ensure the response file does not contain that entry!

The FileFormat and ProductFormat entries are optional, but if present they allow you to customise the format of the version strings. These entries are vaguely similar to printf format specs. The default is simply %a.%b.%c.%d. You can add zero padding to a field by specifying a zero followed by the required field width, e.g. %04d would expand to something like 0047.

If you specify a response file that doesn't exist, or do not specify one at all, one will be created for you in the current directory with the name stampver.inf

Note that if you use the -f or -p options these will override any response file settings.

Integrating with Microsoft Developer Studio

You can set up StampVer to autoincrement build numbers as part of your normal build process. Assuming that your EXE has a version resource, and StampVer is on the path, you simply set up a custom build step for the target.

To do this, get the project settings dialog (Alt-F7), highlight the top level folder for a build, and select the Custom Build tab. Add a build command that looks like this:

    StampVer -vstampver.inf -i4 -j4 $(TargetPath)

Set the output file to be the following:


These settings will store the version number in stampver.inf file in the workspace directory, and will autoincrement the version numbers contained in it before applying it to the FileVersion and ProductVersion elements of the target EXE.

Notes and Queries

Please note that StampVer only operates on Win32 exe/dll files that already have a version resource. It cannot add a version resource if one doesn't exist.

Also be aware that StampVer can only update the FileVersion and ProductVersion strings if there is enough space to do so. An easy way to ensure this is to set your version resource to contain for these strings, and let StampVer overwrite these with the real version numbers.

StampVer will pad version strings to their maximum length with spaces. This feature can be disabled with the -nopad option. This was added when it was found that Dev Studio crashes when it tries to display the version resource for an EXE that StampVer has processed.

Since StampVer operates on the final exe, it will confuse your incremental linker into never linking incrementally! Not much I can do about that though.


StampVer is freeware, and comes with no warranty - you use it at your own risk. If you do experience problems, or have ideas for enhancements, please contact the author, Paul Dixon


Download stampver.zip - 33 kb (Win95 and NT)


  • error: Current ProductVersion string is too small to accomodate update.

    Posted by Ravi on 08/17/2016 01:28pm

    Hi, I am facing the problem regarding Stamping. Stamping D:\MyProject\update.exe: Product Version= error: Current Product Version string is too small to accomodate update. I am creating a feature pack, I have Base Build as and for base build it is working fine. But in feature pack Product Version= I get the error. please help me if any one know the reason.

  • Could change production name

    Posted by Viet Hung on 08/24/2015 07:10am

    I want to change production name of exe file directly. Could StampVer be do it, couldn't it ?

  • Download link

    Posted by James Martin on 10/17/2014 09:59am

    Download link is broken?

  • Version strings

    Posted by Legacy on 03/15/2000 08:00am

    Originally posted by: Dmitry Chernushchenko

    Is it, or will be, possible to modify any version_info strings? For instance, operate with PrivateBuild, SpecialBuild etc. values. That would add some more flexability.

  • Request for a silent option

    Posted by Legacy on 02/04/2000 08:00am

    Originally posted by: Mark Williams

    How about a silent option that suppresses all output except for warnings and errors.

    This would be useful in my batch files that stamp 20 files at once. Because the normal error-free output is a line for each file it hides any errors that get produced.

  • Tip for Visual Basic Users

    Posted by Legacy on 02/04/2000 08:00am

    Originally posted by: Mark Williams

    Visual Basic is strange when it comes to version numbers. I've worked out the following approach though.

    To get Visual Basic's App.Major, App.Minor and App.Revision properties to work successfully you need to ensure the stampver formatting is correct. You must use the -v"stampver.inf" option to specify an information file, not the -p and -v options.

    To stamp a 3 part version number x.y.z into the file so that Visual Basic reads App.Major = x, App.Minor = y and App.Revision = z, your stampver.inf needs to contain:


    The third part of the FileVersion gets ignored by VB so it's safest to set it to zero. The FileFormat just needs to ignore the %c setting completely.

    e.g. to get 15.3.21 into the file use:

    Looking at the version tab of the file properties of a file stamped in this manner shows a string x.y.z. Using VC++ to look at the resource shows the FILEVERSION as x,y,0,z and the FileVersion as x.y.z.

  • v1.4 now at http://www.elphin.com/products/stampver.html

    Posted by Legacy on 09/29/1999 07:00am

    Originally posted by: Paul Dixon

    The links on the CodeGuru stampver page are out of date:

    Current info:


    v1.4 (Sep99) now features checksum updating!


  • Stamping VxDs

    Posted by Legacy on 07/28/1999 07:00am

    Originally posted by: Louis Joubert

    Any chance of stamping the version numbers of VxDs? (I have
    to use the old 16 bit resource compiler to add version info
    to them).


  • source code

    Posted by Legacy on 07/12/1999 07:00am

    Originally posted by: EunJoo An

    Very useful tool

    Will the source code be available anytime soon. We already
    have a automated way of updated the string value of FileVersion. Is there way to update just the Binary FILEVERSION. Thanks

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date