Would like to know from Window Users, how many Backup Data Files are you saving?

Jerry_Jerry_ Member ✭✭✭
Since I am starting to religiously backup my Quicken Data files, I would like estimates on how many Data File Backups you folks are retaining?

For fun, I am testing a Windows Batch Script I created that will show Backup Status and retain a certain number of Backups; deleting older Files via each File's Modified Date (which matches the date found in the File's Name; since each file is created (Modified) only one time).

Enclosing some snapshots of the Screens presented via the Batch Script:
image

image

image


Wish me luck in further developing the Script. I am utilizing Command Parameters for any Options the Script will use.
Now running the 2019 Windows Subscription Plan
Retired - former Computer System Analyst
«1

Comments

  • Roger MRoger M Member ✭✭✭
    edited November 2018
    I configure Quicken to save 5 backups in the backup folder. Additionally, I perform a manual backup after EACH session, to Dropbox AND to an external HD.This has always been enough to get me out of any trouble.Happy scripting!
    Quicken Windows Premier - Subscription **** Windows 10 Home *** Quicken user since 1996
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Roger M said:

    I configure Quicken to save 5 backups in the backup folder. Additionally, I perform a manual backup after EACH session, to Dropbox AND to an external HD.This has always been enough to get me out of any trouble.Happy scripting!

    Thanks. 

    And thanks for your information.
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • QPWQPW Member ✭✭✭✭
    edited May 2018
    Roger M said:

    I configure Quicken to save 5 backups in the backup folder. Additionally, I perform a manual backup after EACH session, to Dropbox AND to an external HD.This has always been enough to get me out of any trouble.Happy scripting!

    Personally I don't use Quicken's backup system.

    My Quicken data file is only one important file to me.  I backup all my files to a NAS and offline using CrashPlan.  To the NAS all files that changed in the last 10 minutes, offline every hour.

    In fact, I don't even consider my Quicken data file my most important file.  My email would probably be the most important to me.
  • ClaytonClayton Member
    edited May 2018
    Roger M said:

    I configure Quicken to save 5 backups in the backup folder. Additionally, I perform a manual backup after EACH session, to Dropbox AND to an external HD.This has always been enough to get me out of any trouble.Happy scripting!

    I too run a batch file after every program exit copying my backup AND the .QDF data file to an External Drive, a WD Elements 2 TB unit. On the PC is only one copy of each of these files. On the WD Elements I keep 10 of the backups. Weekly paring down the ones that would just take up room and maintaining a weekly file.

    I do like your script and would like to have a copy of it. Might make some of my efforts easier.
  • Jerry_Jerry_ Member ✭✭✭
    edited November 2018
    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • Jerry_Jerry_ Member ✭✭✭
    edited November 2018
    QPW, Wow! Sounds interesting.

    I employ an additional backup agent (Norton Security with Backup) to do Schedule Daily backups at night, and Schedule Weekly backups on the first day of the Week after the Daily backup.

    What I do not understand is these folks that have to go back to their backups one or two month(s) prior to fix Quicken problems. It seems to me that they would be aware of their problem one or two days after it occurred, and retrieve a more recent backup. Why go all the way back one to two months. Oh well, to each their own. (grin)
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    Jerry you are better at this than I am. Now I've got something to work on (play with) for the next day or so.

    Thank you Sir and have a good day.
  • splashersplasher SuperUser ✭✭✭✭✭
    edited October 2018
    I don't use Quicken's Automatic Backup routine at all, everything I do is Quicken Manual Backups.


    On a NAS drive, I do a backup after any Quicken session that makes changes to my data file, except downloading quotes in the evening, so I generally have a new backup most days.

    I keep all of those for at least 6 months.  After that, I keep the last backup of the month for the next 2 years of history.  Past that, I keep the last one of the year.


    Separate from that, I have two 4GB thumbdrives and use one to store a backup from the 1st and the other stores a backup from the 15th.  I only delete from them when they run out of space and then delete the oldest year on them.


    I also use cloud storage for overall daily backups of the computer.
    -splasher  using Q since 1996 -  QW2016, 2017 & Subscription  -  Win7/Win10
    -Questions? Check out the  Quicken Windows FAQ list

  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    Any time.

    This might be a result of my 32 years as a System Programmer (LOL)
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    splasher said:

    I don't use Quicken's Automatic Backup routine at all, everything I do is Quicken Manual Backups.


    On a NAS drive, I do a backup after any Quicken session that makes changes to my data file, except downloading quotes in the evening, so I generally have a new backup most days.

    I keep all of those for at least 6 months.  After that, I keep the last backup of the month for the next 2 years of history.  Past that, I keep the last one of the year.


    Separate from that, I have two 4GB thumbdrives and use one to store a backup from the 1st and the other stores a backup from the 15th.  I only delete from them when they run out of space and then delete the oldest year on them.


    I also use cloud storage for overall daily backups of the computer.

    splasher, Thanks for your input. I might change my script to retain 90 or so days of backup files.
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • mshigginsmshiggins SuperUser ✭✭✭✭✭
    edited May 2018
    splasher said:

    I don't use Quicken's Automatic Backup routine at all, everything I do is Quicken Manual Backups.


    On a NAS drive, I do a backup after any Quicken session that makes changes to my data file, except downloading quotes in the evening, so I generally have a new backup most days.

    I keep all of those for at least 6 months.  After that, I keep the last backup of the month for the next 2 years of history.  Past that, I keep the last one of the year.


    Separate from that, I have two 4GB thumbdrives and use one to store a backup from the 1st and the other stores a backup from the 15th.  I only delete from them when they run out of space and then delete the oldest year on them.


    I also use cloud storage for overall daily backups of the computer.

    Those older backups can come in handy.
    Quicken user since Q1999. Currently using QW2017.
    Questions? Check out the  Quicken Windows FAQ list
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    splasher said:

    I don't use Quicken's Automatic Backup routine at all, everything I do is Quicken Manual Backups.


    On a NAS drive, I do a backup after any Quicken session that makes changes to my data file, except downloading quotes in the evening, so I generally have a new backup most days.

    I keep all of those for at least 6 months.  After that, I keep the last backup of the month for the next 2 years of history.  Past that, I keep the last one of the year.


    Separate from that, I have two 4GB thumbdrives and use one to store a backup from the 1st and the other stores a backup from the 15th.  I only delete from them when they run out of space and then delete the oldest year on them.


    I also use cloud storage for overall daily backups of the computer.

    mshiggins, I can imagine.

    I am fortunate in not having to restore a backup as of yet (except for testing the procedure).
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    Hate to have to ask, but which Folder do you keep the script in?
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    I have a Folder by the name of "Batch Jobs" under my Window Users Folder.
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    I'm doing something wrong. This is my 

    set Bkupfolder="E:\Users\Clayton\Documents\Quicken\Backup"

    and I use a C:\Utilities folder that's in the environment variable (path) but the routine only works in the folder I have it in. Glad I had that folder backed up! Moving it to the backup folder on my external drive "E:\Users\Clayton\Documents\Quicken\BACKUP" it returns the error Access Denied.
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    What happens when you right-click on the Job Name and select "Run as Administrator" - no matter where your have the Job? 
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • splashersplasher SuperUser ✭✭✭✭✭
    edited May 2018
    Jerry said:

    QPW, Wow! Sounds interesting.

    I employ an additional backup agent (Norton Security with Backup) to do Schedule Daily backups at night, and Schedule Weekly backups on the first day of the Week after the Daily backup.

    What I do not understand is these folks that have to go back to their backups one or two month(s) prior to fix Quicken problems. It seems to me that they would be aware of their problem one or two days after it occurred, and retrieve a more recent backup. Why go all the way back one to two months. Oh well, to each their own. (grin)

    They could be once or twice a month users and only make monthly backups.  Some users like to devote a day to doing Quicken rather than a little time each day or every other day.  I prefer my pain in small increments.
    -splasher  using Q since 1996 -  QW2016, 2017 & Subscription  -  Win7/Win10
    -Questions? Check out the  Quicken Windows FAQ list

  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    QPW, Wow! Sounds interesting.

    I employ an additional backup agent (Norton Security with Backup) to do Schedule Daily backups at night, and Schedule Weekly backups on the first day of the Week after the Daily backup.

    What I do not understand is these folks that have to go back to their backups one or two month(s) prior to fix Quicken problems. It seems to me that they would be aware of their problem one or two days after it occurred, and retrieve a more recent backup. Why go all the way back one to two months. Oh well, to each their own. (grin)

    "I prefer my pain in small increments." likewise. It avoids the odd nasty surprise finding out your card has been compromised a week or two after the fact.
  • ScooterlamScooterlam SuperUser ✭✭✭✭✭
    edited August 2018
    FWIW, I keep things simple. My backup of the original QDF are to both a local (and separate) hard drive and to Carbonite as the file changes (daily).  So, 3 copies of the same file across, 3 devices and 2 locations. I no longer use Quicken's backup feature.
    Scott2018 QW HBR r8.10
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Scott said:

    FWIW, I keep things simple. My backup of the original QDF are to both a local (and separate) hard drive and to Carbonite as the file changes (daily).  So, 3 copies of the same file across, 3 devices and 2 locations. I no longer use Quicken's backup feature.
    Scott2018 QW HBR r8.10

    Sounds good!
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton, Here is my Script. I do not know if copying and pasting the Script will lose any of its functions ability or not. The only recoding that needs to be done in the Script itself is the changing of the Backup Directory Set Command to reflect your Backup Directory.

    As for Command Parameters:

    1. Command Parameter #1 = Number of Files to Retain (0 thru infinity). If the value is 0, than the Script will only show Statistics about your Backup Data as shown in Screen Shot Number 1. If Blank or contains an Alphanumeric character such as a * (denoting a second Command Parameter present), the default value will be used. Feel free to change the hardcoded value.

    2. Command Parameter #2 = Number of Lines to list as shown in all 3 Screen Shots. If the value is 0, no listing will be attempted. Of course, if blank, the default number of files will be listed. Again, feel free to change the hardcoded value.


    Well, I think that is it. Have fun. (grin)


    ---------------------------------------------------------------------------------------------

    @Echo off
    color 4f
    rem color f0
    title Quicken Backup Data File Clean-Up Utility
    setlocal enableextensions
    rem *****************************************************************************
    rem ******  Data File Utility in working with Quicken Data Backups *******
    rem *     To be utilized with Windows 7 and above Operating Systems.             
    rem *                  (Date format = (06/08/2015)                              
    rem *              (Time format = (13:05 - 24 hour setting)                     
    rem *            (Backup Drive = E - External Portable Drive)                   
    rem *****************************************************************************
    rem **        Please replace the following (SET) line with you own           **
    rem *                            Directory location                            
    set Bkupfolder=E:\Quicken Data Backups
    rem *****************************************************************************
    rem *                           (Date format = 06/08/2015)                     
    set CurDate=%DATE%
    rem *                     (Time format = (13:05:60:MS - 24 hour setting))       
    rem *                     Morning Hours have leading space vs leading zero.     
    set ActHR=%TIME:~0,2%
    if "%TIME:~0,1%"==" "  set ActHR=0%ActHR:~1,1%
    set CurTime=%ActHR%%TIME:~2,3%
    rem ******************************************************************************
    rem *                            Calculate the Run Julian Date                   *
    set DSYr=%DATE:~6,4%
    set DSMth=%DATE:~0,2%
    set DSDay=%DATE:~3,2%
    rem -------------------------------------------------------------------------------------------
    call :CvtJulian %DSMth% %DSDay% %DSYr%
    rem -------------------------------------------------------------------------------------------
    set RunJDN=%JDN%
    rem *******************************************************************************
    rem * The Script will utilize the keeping of the number of days of Quicken Data            *
    rem * Backup Files as specified by the Retain Files Field shown below.                        *
    rem *                                                                                                                                *
    rem * If the Retain Files Field has a Value of Zero (0), the Script will only                      *
    rem * display Statistics about the Files in the Directory. Otherwise, it will set                 *
    rem * the "Retain Files" Interval by utilizing Julian Dates to convert the New                 *
    rem * Date Limit formatted YYYY-MM-DD in showing for Informational purposes only. *
    rem *  (The below Retain Files Field Value will keep two weeks of Quicken Data          *
    rem *   Backup Files in the Backup Directory; if no User Input via Command Line.)       *
    rem ----------------------------------------------------------------------------------------------
    rem *               Accept any Incoming User Number of Files to Retain            *
    if "%~1" lss "0"  (
                   set Dayts=14
               ) else (
                   set /a Dayts=%~1+0 )
    rem -----------------------------------------------------------------------------------------------
    set RetainFiles=%Dayts%
    rem -----------------------------------------------------------------------------------------------
    set /a AdjJDN=%RunJDN%-%RetainFiles%+1
    call :CvtDate %AdjJDN%
    set CutDate=%yy%-%mm%-%dd%
    rem ***********************************************************************************
    rem *  The Script will also utilize the keeping of the number of Files to View    *
    rem *  as specified by the Num of Fles Field shown below. If the User Input is *
    rem *  found to be a zero (0), no listing of files will be initiated.                          *
    rem *  ** Also currently the Script will only allow entries of 0 thru 9. due to        *
    rem *  ** the Creator's inexperienced in allowing two-digit numbers in the coded  *
    rem *  ** dir commands.                                                                                       *
    rem *   (The below Number of Fles Field Value will list 5 Files in the Backup     *
    rem *    Directory; if no User Input via Command Line.)                              
            *
    rem --------------------------------------------------------------------------------------------------
    rem *                  Accept any Incoming User Number of Files to List                  *
    if "%~2" equ ""  (
                   set Filets=5
              ) else (
                   set /a Filets=%~2+0 )
    rem ---------------------------------------------------------------------------------------------------
    set NumofFles=%Filets%
    if %NumofFles% gtr 9      set NumofFles=9
    rem ---------------------------------------------------------------------------------------------------
    rem *************************************************************************************
    cls
    Echo(
    Echo                    Quicken Data File Clean-Up Utility
    Echo       %CurDate%                                        %CurTime%
    Echo(
    Echo                    ** Retrieving Backup Data Files. **
    rem ----------------------------------------------------------------------------------------------------
    If %RetainFiles% equ 0        goto ShwDir
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep the latest %RetainFiles% Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    goto Cont
    rem ---------------------------------------------------------------------------------
    :ShwDir rem ************************ Label ShwDir ***********************************
    echo --------------------------------------------------------------------------------
    echo     You have chosen to keep your Data Files in the Directory;
    echo     (%Bkupfolder%)
    echo --------------------------------------------------------------------------------
    rem **************************************************************************************
    :Cont rem ************************** Label Cont ***************************************
    set BkupDrv=%Bkupfolder:~0,2%
    rem ----------------------------------------------------------------------------------------------------
    %BkupDrv%
    cd %Bkupfolder%
    rem **************************************************************************************
    rem ******  Check to see if there are data files in Directory *************************
    set ctr=0
    for %%x in (*) do set /a ctr+=1
    If %ctr% neq 0                goto Cont1
    echo     NO Backup Data Files in Directory!!
    echo --------------------------------------------------------------------------------
    goto EndPrc
    rem ****************************************************************************************
    :Cont1 rem ************************* Label Cont1 ***************************************
    If %RetainFiles% equ 0        goto ShwStat
    rem ******  Check No. of Files to see if there are more data files than needed ******
    If %ctr% leq %RetainFiles%    goto Cont2
    rem --------------------------------------------------------------------------------------------------------
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    echo     Any Backup Data File having a Modified Date previous to the one below shown
    echo                             will be deleted.
    echo                               (%CutDate%)
    echo     (The Above Modified Date will also match the Date found in the selected 
    echo      Backup Data File Names; since each Backup Data File was created (Modified) 
    echo      only ONCE).
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    forfiles /d -%RetainFiles% /c "cmd /c del /q @file">;nul
    rem ******  Retrieve the revised number of data files in the Directory. ******************
    set ctr1=0
    for %%x in (*) do set /a ctr1+=1
    set /a DelCnt=%ctr%-%ctr1%
    echo     Number of Files deleted = %DelCnt%.
    echo --------------------------------------------------------------------------------
    set ctr=%ctr1%
    goto Cont3
    rem ******************************************************************************************
    :ShwStat rem *********************** Label ShwStat **************************************
    If %ctr% equ 1             goto Show     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0       goto EndPrc
    echo     Listing up to the first %NumofFles% newest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto Cont4
    :Show rem ************************** Label Show *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /o-d|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont2 rem ************************* Label Cont2 *****************************************
    echo     Found no Backup Data Files exceeding the %RetainFiles%-File Limit to Delete.
    rem ******************************************************************************************
    :Cont3 rem ************************* Label Cont3 *****************************************
    If %ctr% equ 1             goto Show1     
    echo     There are %ctr% data files in the Directory.
    echo --------------------------------------------------------------------------------
    rem ******************************************************************************************
    :Cont4 rem ************************* Label Cont4 ******************************************
    If %NumofFles% equ 0        goto EndPrc
    echo     Listing up to the first %NumofFles% oldest entries in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-%NumofFles%]:"
    echo --------------------------------------------------------------------------------
    goto EndPrc
    :Show1 rem ************************* Label Show1 *****************************************
    echo     There is only %ctr% data file in the Directory.
    echo --------------------------------------------------------------------------------
    If %NumofFles% equ 0        goto EndPrc
    echo            Listing the only entry in the Directory.
    echo --------------------------------------------------------------------------------
    dir /b /p /w /od|findstr/n ^^|findstr "^[1-1]:"
    echo --------------------------------------------------------------------------------
    rem *******************************************************************************************
    :EndPrc rem ************************* Label EndPrc ***************************************
    pause
    endlocal
    color
    exit /b
    rem *******************************************************************************************
    rem ********************************* Subroutines *******************************************
    rem *******************************************************************************************
    :CvtJulian rem ******************* Subroutine CvtJulian ***********************************
    rem *******                  Convert Date to Julian Day Number                 *******
    rem ****                     Retrieve Month, Day, and Year Values                 ****
    rem *                            (Date format = 06/08/2015)                          *
    set mm=%1%
    set dd=%2%
    set yy=%3%
    rem *                        Eliminate Left Zeros (dd & mm)                          *
    set /a dd=10%dd% %% 100, mm=10%mm% %% 100
    rem *                        Calculate Julian Day Number                             *
    if %mm% lss 3     set /a mm+=12, yy-=1
    set /a A=yy/100, B=A/4, C=2-A+B, E=36525*(yy+4716)/100, F=306*(mm+1)/10
    set /a JDN=C+dd+E+F-1524
    exit /b
    rem ********************************************************************************************
    :CvtDate rem ********************** Subroutine CvtDate ************************************
    rem **                  Convert Julian Day Number to Month, Day, Year               **
    rem *                         (Date format = 06/08/2015)                             *
    set /a W=(%1*100-186721625)/3652425, X=W/4, A=%1+1+W-X, B=A+1524
    set /a C=(B*100-12210)/36525, D=36525*C/100, E=(B-D)*10000/306001, F=306001*E/10000
    set /a dd=B-D-F, mm=E-1, yy=C-4716
    if %mm% gtr 12      set /a mm-=12, yy+=1
    rem *                   Insert Left Zeros, If needed                                  *
    if %dd% lss 10        set dd=0%dd%
    if %mm% lss 10      set mm=0%mm%
    exit /b

    ---------------------------------------------------------------------------------------------

    Clayton, still having troubles?
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    QPW, Wow! Sounds interesting.

    I employ an additional backup agent (Norton Security with Backup) to do Schedule Daily backups at night, and Schedule Weekly backups on the first day of the Week after the Daily backup.

    What I do not understand is these folks that have to go back to their backups one or two month(s) prior to fix Quicken problems. It seems to me that they would be aware of their problem one or two days after it occurred, and retrieve a more recent backup. Why go all the way back one to two months. Oh well, to each their own. (grin)

    I guess that you do have those sort of people who are too busy to spend a small amount of time each day updating their financial data.. Must save a lot of paper receipts! (grin)
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • Jerry_Jerry_ Member ✭✭✭
    edited November 2018
    Clayton is your Account in your Window OS flagged as Administrator or Standard?
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ScooterlamScooterlam SuperUser ✭✭✭✭✭
    edited May 2018
    Scott said:

    FWIW, I keep things simple. My backup of the original QDF are to both a local (and separate) hard drive and to Carbonite as the file changes (daily).  So, 3 copies of the same file across, 3 devices and 2 locations. I no longer use Quicken's backup feature.
    Scott2018 QW HBR r8.10

    I appreciate you sharing your effort, for sure.  
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    Local Administrator
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    let's start all over again. (grin)

    I was confused by your comment  "but the routine only works in the folder I have it in.".

    The global
    set Bkupfolder="E:\Users\Clayton\Documents\Quicken\Backup"
    only points to the Folder where only your Backup Files reside; not the Script itself.


    You should always run the Script from where it physically resides (C:\Utilities).

    Since I am always faced with the Windows Desktop, what helps me is to go to where the program physically resides;
    1. Right click on it's Name and choose (Send to>Desktop (create shortcut))  from the dropdown menus.
    2. Then on the Windows Desktop, move the shortcut Icon to where you want it to reside.
    3. Rename the shortcut icon title if you want.

    What is neat is when you right-click on the Icon, a menu appears on which you can choose many options; like Edit. This will open an Editor Program like Notepad with the Script coding so that one can change, add, delete any part of the coding. After one finishing changing the coding, one should save the changes.


    Then, all you have to do is click on the Icon to execute the Script.


    Does this make any sense? (grin)
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    Oh it completely makes sense. BUT residing in C:\Utilities and running it, it deletes most of the files in that folder and none in the E:\Users\Clayton\Documents\Quicken\Backup folder. Not knowing where you ran it from, I moved it oi the E:\... and ran it from there giving me the Access Denied error.

    I realize I'm not close to your abilities, but I'm not giving up on it either. This IS a handy script. One I can use. I certainly appreciate your efforts and time. Thank you.
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    Here is where I am running it from. Notice the Pathway Line at the top of the Window.

    image
    It is actually in my "Windows (C:)/Users/jerry/batch jobs" Folder.
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
  • ClaytonClayton Member
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    Much the same as here:

    image
  • Jerry_Jerry_ Member ✭✭✭
    edited May 2018
    Jerry said:

    Clayton is your Account in your Window OS flagged as Administrator or Standard?

    Maybe I would suggest taking the hyphen (-) out of the name; thus showing "CleanUp" vs. "Clean-Up". Thus your Script Name would be;
     "QDF Backup File CleanUp  Utility.bat".

    Or even replacing the "-" with a space might work..


    When you run "DeleteFolder.bat", do you have any Problems?
    Now running the 2019 Windows Subscription Plan
    Retired - former Computer System Analyst
This discussion has been closed.