Link to home
Start Free TrialLog in
Avatar of sher19
sher19

asked on

how do i add date to my folder name/

I have this batch from expert here.
I would liek to add the date on the end of each of these folders, but it is not working for me.
please tell me the problem in my script?

setlocal enabledelayedexpansion
for %%a in (data processing audit percentages finalized) do call :process %%a
goto :eof

:process
set /p myDir=Enter the %1 folder name:
md "%mydir%_%date%"
set mydir=
Avatar of sirbounty
sirbounty
Flag of United States of America image

Hi sher19, you need to grab the month/day/year?  
Use this...(if echo %date% returns the 'day' for you...)

setlocal enabledelayedexpansion
for %%a in (data processing audit percentages finalized) do call :process %%a
goto :eof

:process
set /p myDir=Enter the %1 folder name:
md "%mydir%_%date:~4,2% %date:~7,2% %date:~10%"
set mydir=
ASKER CERTIFIED SOLUTION
Avatar of sirbounty
sirbounty
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Happy to help - thanx for the grade! :^)