0: :; $( cd "$( dirname "$0" )" && pwd )/buildrev.sh; exit $? 1: @echo off 2: SetLocal EnableDelayedExpansion 3: 4: for /f "tokens=*" %%A in ('hg parent -R "%~dp0.." --template "{date|isodate} {branch} r{rev} {node|short}"') do set rev=%%%A 5: 6: echo char hello[] = "Rev: %rev% Built: " __DATE__ " " __TIME__; > "%~dp0build.h" 7: 8: EndLocal 9: