Deleting Unnecessary Files from the iMedConsent Server
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. echo Removing old documentService log files forfiles /p C:\documentService\bin /s /m trace*.* /d -120 /c "cmd /c del @path" echo. echo Removing old emrRun log files forfiles /p C:\documentService\emrRun\bin /s /m trace*.* /d -120 /c "cmd /c del @path" echo. echo Removing old image files forfiles /p D:\DocumentStore\imagingShare /s /m *.tif* /d -120 /c "cmd /c del @path" echo. 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.
- On the iMedConsent server, navigate to Start -> Control Panel -> Scheduled Tasks.
- Click on "Add Scheduled Task." The following will be displayed:
- Click “Next” to begin the Scheduled Task Wizard.
- Click the “Browse” button and navigate to the delfiles.bat file at “C:\documentService\Maintenance”.
- Select the file and click the “Open” button.
- Select the frequency for the file to run at, then click “Next”.
- Select other frequency rules on this screen (which are dependent on what was entered on the previous screen).
- 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.
- Click the “Finish” button to complete the process.