Home > other >  How to match the date in the DOS command
How to match the date in the DOS command

Time:11-19

# how to remove the date fill in 0
On August 1 # # f: today, the generated file name is 8.1 ()
My order:
@ echo off
Date: set the month=% %
~ 5, 2The set day=% date: ~ 8, 2 %

Echo the month % % | findstr searches "^ 0 + \ d + $" & gt; Nul
If % % errorlevel equ set the month=% 1 month: % ~ 1, 1

Md month % %
Echo to create a name for: % the month % folder

Pause

Question:
How to filter 0 at the beginning of the month and date
  • Related