Could you please tell me whats wrong with this batch file ... it doesnt accept the variable (Najib) though its identified...I want it to create a directory by the year and then get into it and create another folder with the month.
This is the script...
(Note: i have a utility that recognizes the cut command since i have no idea how to do it in DOS)
#@echo off
Set ToDay=%3
Set Nael=Date /T | cut -c 5-6
Set Najib=Date /T | cut -c 11-15
If not "%ToDay%"=="" GoTo EXEC
For /F "Tokens=2 Delims= " %%a in ('Date /T') Do Set Today=%%a
:EXEC
pause
if not exist c:\batch_files\ammar\%Najib% GoTo CREATES
For /F "Tokens=1-4 Delims=/ " %%a in ('Date /T') Do @echo md %%d > mdyear.bat
call mdyear.bat
del c:\batch_files\ammar\mdyear.bat
:CREATES
pause
For /F "Tokens=1-4 Delims=/ " %%a in ('Date /T') Do @echo cd %%d > cdyear.bat
call cdyear.bat
del C:\batch_files\ammar\cdyear.bat
if not exist c:\batch_files\ammar\%Najib%\%Nael% GoTo CREATE
For /F "Tokens=1-4 Delims=/ " %%a in ('Date /T') Do @echo md %%b > c:\batch_files\ammar\%Najib%\mdmo.bat
call c:\batch_files\ammar\%Najib%\mdmo.bat
del c:\batch_files\ammar\%Najib%\mdmo.bat
:CREATE
Set ToDay=
thanks for your cooperation.
Aladimi