@echo off rem Script Template (template.cmd) for NT. rem Justin Mercier, Boeing Autometric rem justin.f.mercier@boeing.com rem Script Preamble :: Set local scope setlocal & pushd & set RET= set TITLE=Enter Title for Script set VERSION=Enter Version Number set INIFILE= set LIBFILE=_cmdlibs :: Detect debug level @if not "%ECHO%"=="" echo %ECHO% if "%DEBUG%"=="1" (set TRACE=echo) else (set TRACE=rem) if /i {%1}=={/help} (call :HELP %2) & (goto :HELPEXIT) :: Initialize procedure status code return variable set RET= :: Parse script name and path from CLA set SCRIPTNAME=%~n0 set SCRIPTPATH=%~dp0 :: Detect cry for help if /i {%1}=={/?} (call :HELP %2) & (goto :HELPEXIT) :: Call OSCHECK from lib file to determine if OS is compatible call %LIBFILE% :OSCHECK if "%RET%" EQU "1" ( echo Invalid OS. Exitting.... goto :DOSEXIT ) ELSE ( %TRACE% OS: Windows %NTREV% ) :: Call C style main function call :MAIN %* goto :EXIT :: Exit function for HELP proc :HELPEXIT popd & endlocal & set RET=%RET% goto :EOF :: Help function if help detected in CLA :HELP if defined TRACE %TRACE% [Command entered: %0 %*] rem PLACE HELP MESSAGE HERE goto :EOF :: C style main function :MAIN if defined TRACE %TRACE% [Command entered: %0 %*] rem place main script here goto :EOF :: Exit handle for incompatible or unknown OS :DOSEXIT echo This utility ^(%SCRIPTNAME%^) requires Windows NT or 2000. popd & endlocal & set RET=%RET% pause exit :: Default Exit handle :EXIT popd & endlocal & set RET=%RET% pause exit