![]() ![]() ![]() :: This batch file will always display the same results, :: and converted to batch code by Ron Bakowski. :: provided by Doctor Fenton on the Math Forum :: algorithm from the Astronomical Almanac, :: Algorithm based on Fliegel-Van Flandern :: Modified to handle months and days without leading zeros :: Code taken from datediff.bat written by Rob van der Woude :: routine was corrected with help from Alexander Shapiro :: First strip leading zeroes a logical error in this :: Call :_JDate %_GYear% %_GMonth% %_GDay% If Not !_Jdate! LSS %_JStart% If !_Jdate! LEQ !_JEnd! (Echo Del %%I) Else (Goto _Done))) :: Remove -H and/or -S to include Hidden and/or System filesįor /F "Tokens=*" %%I In ('Dir /A-D-H-S /B /OD /TW') Do ( Set /P _Resp=Press Y to confirn dates, any other key to re-enter: If "%%J"="" (Echo.)&Echo Missing Date, Please Reenter dates&Goto _Ask ![]() If Not "%_sDate%"=" " Echo You may use a space instead of %_sDate%Įcho.If the year is not specified, %_CurYr% will be used.įor /F "Tokens=1,2 Delims=," %%I In ("%_Dates%") Do ( If %_iDate%=2 Set _Format=YY]%_sDate%M%_sDate%DĮcho.Enter the range of dates to be deleted from %_Src%Įcho.Enter the two dates in this format: %_Format%,%_Format% in any orderĮcho.Year must be 2 or 4 digits, Leading zeros are not required for month or day If %_iDate%=1 Set _Format=D%_sDate%M%_sDate%YY] If %_iDate%=0 Set _Format=M%_sDate%D%_sDate%YY] :: Hidden and system files will not be Off :: folder path in the program on the Set _Src= line :: Put this batch file in the parent folder or set the :: Drag and drop the folder, specify on command line, :: is more than 30 days a warning will be displayed. Leading zeros not needed on month or date, can enter ![]() :: Year can be 2 or 4 digits, if not specified uses current :: Deletes files from a folder based on entered dates ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |