@echo off
:getversion
REM 1.
set /p VersionNumber=Enter the Version Number:
REM 2.
for /f "tokens=1-3 delims=-" %%a in ("%VersionNumber%") do set Major=%%a& set Minor=%%b
REM 2.1 Revision of Version Number format
if not "%Major%-%Minor%" == "%VersionNumber%" goto getversion
REM 2.2 Revision of Major and Minor be numbers
set /a NMajor=Major, NMinor=Minor > NUL
if not "%NMajor%" == "%Major%" goto getversion
if not "%NMinor%" == "%Minor%" goto getversion
REM 3.
for %%a in (*.PDF) do ren "%%a" "%%~Na_%VersionNumber%_Software Operations Manual.pdf"
REM 4.
pushd \webserver\downloads
move "EMDM*Software Operations Manual.pdf" supserseded
REM 5.
popd
copy "EMDM*Software Operations Manual.pdf" \webserver\downloads
REM 6.
del "EMDM*Software Operations Manual.pdf"
REM Steps 5 and 6 above is the same as just one MOVE
Я изменил версию номера версии более простым способом.