hi,
can someone please help me.
create a folder based on the current month & year (ie... December 2017, January 2018 and so on)
it should change automatically every month..
thanx in advance
creating folder
Moderator: DosItHelp
Re: creating folder
This was all from searching the forums and the Internet. The list goes on and on.
or
or
Code: Select all
@echo off
REM Get date and time in YYYYMMDDhhmmss format
for /f "tokens=2 delims==." %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set "months=01-January;02-February;03-March;04-April;05-May;06-June;07-July;08-August;09-September;10-October;11-November;12-December"
CALL set "months=%%months:*%MM%-=%%"
(set "monthname=%months:;=" & set /p "=%" ) <nul >nul
echo %monthname% %YYYY%
pause
Code: Select all
@echo off
setlocal EnableDelayedExpansion
for /f "tokens=2 delims==." %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set m=100
for %%m in (January February March April May June July August September October November December) do (
set /A m+=1
set "month[!m:~-2!]=%%m"
)
set "monthName=!month[%MM%]!"
echo %monthName% %YYYY%
pause
Code: Select all
@echo off
for /f "tokens=2 delims==." %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
IF "%MM:~0,1%"=="0" SET "MM=%MM:~1%"
FOR /f "tokens=%MM%" %%G in ("January February March April May June July August September October November December") do set monthname=%%G
echo %monthName% %YYYY%
pause
Re: creating folder
hi
thank you squashman so kind of you..
have a nice weekend..
thank you squashman so kind of you..
have a nice weekend..