Skip to content

Instantly share code, notes, and snippets.

@FleXoft
Created January 18, 2021 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FleXoft/e25c0fe3c2df36fcd7e94813ded884b6 to your computer and use it in GitHub Desktop.
Save FleXoft/e25c0fe3c2df36fcd7e94813ded884b6 to your computer and use it in GitHub Desktop.
BATCH loop counter with leading zero
@echo off
setlocal enabledelayedexpansion
SET d=10
for /L %%t IN ( ) DO (
SET /A d = !d! + 10
rem echo alma !d!
set "formattedValue=0000000000!d!"
echo !formattedValue:~-5!
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment