I want to create a new folder in the current directory with the current date and time and save the string to a variable to save other files inside the directory.
This is what I have tried so far.
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME%") do (set mytime=%%a%%b)
set dirname /f = %mydate%_%mytime%
mkdir "%dirname%"
copy a.txt %dirname%/
copy b.txt %dirname%/
copy c.txt %dirname%/
The variable dirname contains the name of the folder that I want. But, I cant use it to make a directory and copy files in it.