Appending a date at the end of a backup file using Task Scheduler

If you are following the Automatic Backup article, you may have a need to append the date at the end of the file which cannot be done using the arguments in task scheduler.

To do so, you would need to create a .bat file that would get the date from the machine (most likely the server), launch database maintenance and run the backup. Then task scheduler would run off the .bat file instead.

First, open up Notepad by going to Start -> All programs -> Accessories -> Notepad. Then, copy and paste the following command lines:


@REM Date forumla used:
@Rem parses out the date string (%date% in command prompt) by using tokens

for /f "tokens=1-4 delims=/ " %%i in ("%date%") do (
set dow=%%i
set month=%%j
set day=%%k
set year=%%l
set datestr=%month%_%day%_%year%


start "" "C:\Program Files (x86)\ACCTivate\AcctivateDBMaint.exe" /B /C Demo /O /SILENT /F "ACCTivate_%datestr%.bkf"

Once the above text is in Notepad, Click “File” -> “Save as” ->  then type in something like “Acctivate backup – Appends Date.bat” and click save. It will look like this when it’s saved:

task scheduler with bat file - help article 2

Then start Task scheduler by going to Task Scheduler from Windows Start Menu > All Programs > Accessories > System Tools.

  1. Click on Create Basic Task
  2. Enter Acctivate Database Backup in the Name field and click Next
  3. Choose the backup frequency for the Task Trigger then click Next.  The default Daily option is recommended.
  4. Leave the default Recur every 1 days setting and click Next
  5. Leave the default Action of Start a program and click Next
  6. Click Browse… to select the Program/script
  7. Then browse to the .bat file location.

After browsing to the .bat file location, you don’t need to change anything else except when you want to run the .bat file. See below.


Posted in Database, Technology - Last modified on March 29, 2017
Still need help?
Search all content on this site, contact support at 817-870-1311, or create a support ticket.