To Find Day, Month and Year of System Date using Dos batch

@echo off
echo %date%  // It shows system date Thu 02/13/2014

For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (
    SET Day=%%b
    SET Month=%%a
    SET Year=%%c)   // Tokens it will tokenize the date format from 2,3&4 , using delimiter / and space   
from date (Thu 02/13/2014) and it assign the value into a,b,c a contains month,b contains day and c contains Year
echo %Day%

Pause
if %Day%==06 goto :l1
 goto end
:l1
 call date.bat // We can all other bat
:end

No comments:

Post a Comment