Hi, this is for make a directory with name of date:
Set MM=%date:~4,2%
Set DD=%date:~7,2%
Set YYYY=%date:~-4%
md %YYYY%-%MM%-%DD%
please explain me this
%date:~4,2% ?!!!!!!
%date:~7,2% ???????!!!!!!
%date:~-4% ؟؟؟؟؟؟!!!!
please explain me this
Moderator: DosItHelp
-
- Posts: 84
- Joined: 08 Sep 2010 10:25
- Location: Iran,Kashan
- Contact:
Re: please explain me this
This method is not safe.
Check the output of
If you find something like ...
... it would work for you.
The next 2 characters after the 4th is the month.
The next 2 characters after the 7th is the day.
The last 4 characters is the year.
For additional informations type SET /? to the command prompt.
Regards
aGerman
Check the output of
Code: Select all
echo %date%
If you find something like ...
Wed 12/01/2010
... it would work for you.
The next 2 characters after the 4th is the month.
The next 2 characters after the 7th is the day.
The last 4 characters is the year.
For additional informations type SET /? to the command prompt.
Regards
aGerman