I need to write a bat file which creates a new folder using current date and time for folder name. I came up with the following:
for /f 'tokens=1-3 delims=:,' %%i in ('%TIME%') do md %DATE%-%%i.%%j.%%k
Does this code has any flaws? Is there an easier / more natural way to do it?
You can use a substring and the built-in %DATE% and %TIME% variables to do this: