Last active
October 24, 2016 03:04
-
-
Save prasadrahul/0a5c821f1a7146b146344f7573de3b06 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[code language="Batch"] | |
@echo OFF | |
::################################################### | |
::NOTE:- This script can with in month Range only # | |
::################################################### | |
::------------------------------------------------------ | |
::SET Today=%Date:~10,4%-%Date:~4,2%-%Date:~7,2% | |
:: ^ ^ ^ ^ ^ | |
:: | | | | | | |
:: Year | Dash Month Day | |
:: | | |
:: Number of chars | |
::------------------------------------------------------ | |
echo #=#=#=#=#=#=#=#=#=#=#=#=#=#=# | |
echo Current Date is : %DATE% | |
echo ###################################### | |
::Set Start Time HH:MM | |
set wDEMOTIME=12:45 | |
::Set Start DATE dd-mm-yyyy | |
set wSTARTDATE=05-16-2015 | |
::Set END DATE dd-mm-yyyy | |
set wENDDATE=05-18-2015 | |
echo Start Date is: %wSTARTDATE% | |
echo End Date is: %wENDDATE% | |
echo ###################################### | |
::Variable for Start Time setup | |
set sHOUR=%wDEMOTIME:~0,2% | |
set sMINUTE=%wDEMOTIME:~3,2% | |
::Variable for start date setup | |
set sMONTH=%wSTARTDATE:~0,2% | |
set sDATE=%wSTARTDATE:~3,2% | |
set sYEAR=%wSTARTDATE:~6,4% | |
::Variable for end date setup | |
set eMONTH=%wENDDATE:~0,2% | |
set eDATE=%wENDDATE:~3,2% | |
set eYEAR=%wENDDATE:~6,2% | |
ECHO Enter Either Y or N: | |
CHOICE /M "Do yo really want to quit" | |
::Keep level in decreasing order | |
IF ERRORLEVEL 2 Goto Nop | |
IF ERRORLEVEL 1 Goto Yes | |
Goto End | |
echo PWD: %cd% | |
:Yes | |
FOR /L %%d IN (%sDATE%,1,%eDATE%) DO ( | |
:: Changing Date | |
Date %%d-%sMONTH%-%sYEAR% | |
:: Changing Time | |
Time %sHOUR%:%sMINUTE% | |
echo Running required commands | |
::Here ==> Run required task with in date and time Range | |
) | |
Goto End | |
:Nop | |
echo Exit the command promt | |
:End | |
pause | |
[/code] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment