Deleting Unnecessary Files from the iMedConsent Server

From Docs

Jump to: navigation, search

Trace logs, images and completed document files are retained on the server until manually purged by an IT administrator. These files should be removed on a regular basis to free-up system storage space.

This process can easily be automated using a simple batch file and Windows Scheduled Tasks.

A batch file has been created for this purpose and is now distributed with each iMedConsent release. The file is named delfiles.bat and is stored at “C:\documentService\Maintenance” on the iMedConsent server.

The file reads:

@echo off
echo Removing old documentService log files
forfiles /p C:\documentService\bin /s /m trace*.* /d -120 /c "cmd /c del @path"
echo Removing old emrRun log files
forfiles /p C:\documentService\emrRun\bin /s /m trace*.* /d -120 /c "cmd /c del @path"
echo Removing old image files
forfiles /p D:\DocumentStore\imagingShare /s /m *.tif* /d -120 /c "cmd /c del @path"
echo Removing old completed jobs
forfiles /p D:\DocumentStore\storeToPurge /s /m iMedDoc*.* /d -120 /c "cmd /c del @path"

The default for deletion in this batch file is files over 120 days old, “/d -120”. This value may be edited. For example, “/d -60” for files over 60 days old or “/d -180” for files over 180 days old.

Using Windows Task Scheduler to Automatically Run delfiles.bat

Windows Task Scheduler is used to configure the batch file to run on a specific schedule or cycle.

  1. On the iMedConsent server, navigate to Start -> Control Panel -> Scheduled Tasks.
  2. Click on "Add Scheduled Task." The following will be displayed:


  3. Click “Next” to begin the Scheduled Task Wizard.


  4. Click the “Browse” button and navigate to the delfiles.bat file at “C:\documentService\Maintenance”.


  5. Select the file and click the “Open” button.


  6. Select the frequency for the file to run at, then click “Next”.


  7. Select other frequency rules on this screen (which are dependent on what was entered on the previous screen).


  8. Enter user name and password to establish the user authentication for running the file. If the user is part of a password change policy, be sure to update the password or the batch file will not run. An entry in the Event Viewer will be created if authentication fails.


  9. Click the “Finish” button to complete the process.
Personal tools