Home > Mobile >  How to verify the format of a date in batch?
How to verify the format of a date in batch?

Time:06-18

I write a batch script and I want to verify that the user enters a date in correct format like DD-MM-YYYY.

But I have a problem with a variable. I can display its value with the command echo, but the further processing of the variable´s value does not work as expected and so the if condition doesn't work, too. I don't understand where the problem is!

Here is my batch script:

@echo off
cls

:A
echo.
set /p date=Quelle date souhaitez vous enregistrer (JJ-MM-AAAA) ?

for /f "tokens=1,2,3 delims=-" %%a in ("           
  • Related