Click here to Skip to main content
15,896,496 members
Articles / Desktop Programming / Win32

Simple Version Resource Tool for Windows

Rate me:
Please Sign up or sign in to vote.
4.83/5 (65 votes)
3 Sep 2012CPOL9 min read 372.5K   27.4K   169  
A utility for creating version info on executable files without Resource Compiler
:=================================================================================
: This is verpatch demo for a SAMPLE PROJECT 
: Set version info on all exe, dll, sys files.
: Assume the files are in one flat directory, otherwise consider using FOR /R
:
: See readme.txt for list of the version info properties you may want to use.
:=================================================================================

@echo verpatch demo

@echo off
setlocal enabledelayedexpansion
if ERRORLEVEL 1 exit

: 1. Define the version to set on all files, and  (optional) custom build comments

set VERSION="1.2.3.4 (%date%)"
set BUILDINFO=/s pb "Built by %USERNAME%"

: 2. Put here custom descriptions for each file. Unlisted files get default description.

set foo.exe.desc="foo exe application"
set moo.dll.desc="moo dll description"
set shmoo.sys.desc="shmoo sys driver"


: 3. The company and product info

set COMPINFO=/s company "sample company" /s (c) "(c) Sample copyleft 2009"
set PRODINFO=/s product "sample product" /pv "1.0.22.33"

: 4. Ready to go...

for %%f in (*.exe *.dll *.sys) do call :putver "%%f"

echo *** All done***
exit /b 0

: ============ subroutine: run verpatch on one file =================
:putver

set _file=%~nx1
echo processing file [%_file%]

if defined %_file%.desc (set FILEDESCR=/s desc !%_file%.desc%!) else (set FILEDESCR=)

verpatch.exe /va "%_file%" %FILEDESCR% %VERSION% %COMPINFO% %PRODINFO% %BUILDINFO%
if ERRORLEVEL 1 pause
goto :EOF

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions