Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
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