« Posts tagged Philip Zymed Holter Configuration Backup Script

Philips Zymed Holter Configuration File v2.9.4 Backup Script

Being the sole IT support person for Philips Zymed where I am employed I sometimes get calls about a configuration that the reader has changed and is unable to restore to their original settings.  Being an IT individual, I am not well versed in all of the Holter tools and functions.  So I did some research to determine where the Holter application configuration information was stored. I wrote a script that I placed in the startup folder on the PC to backup the Holter configuration files every time a reader logs on to the system.  When I receive a call with a configuration issue, all I have to do is restore my backed up files.  These backup configuration files have a date/time stamp attached which allows me multiple configuration files I can restore from.  See DOS BATCH script below:

@echo off
setlocal
CLS

echo Holter Configuration File Backup (v100a)
echo (c) 2011 Your Company Here (08/29/2011)
echo. 

REM
REM Break Date and Time down into managable pieces
REM
call :SETTIMEVARS

REM
REM Set some environment variables for easy alterations later.
REM
set USRCFGPATH=%APPDATA%\Holter
set USRBKUPPATH=%APPDATA%\Holter\Backup
set APPCFGPATH=%ALLUSERSPROFILE%\Application Data\Holter
set APPBKUPPATH=%ALLUSERSPROFILE%\Application Data\Holter\Backup

REM
REM Copy the User Configuration Files to the Backup Folder and time stamp the files.
REM
mkdir "%USRBKUPPATH%" > NUL: 2>&1
copy /v "%USRCFGPATH%\CentralUsrConfig.ini" "%USRBKUPPATH%\CentralUsrConfig.ini.%CCTIME%"
copy /v "%USRCFGPATH%\HolterUsrConfig.ini" "%USRBKUPPATH%\HolterUsrConfig.ini.%CCTIME%"
copy /v "%USRCFGPATH%\RemoteUsrConfig.ini" "%USRBKUPPATH%\RemoteUsrConfig.ini.%CCTIME%"

REM
REM Copy the App Configuration Files to the Backup Folder and time stamp the files.
REM
mkdir "%APPBKUPPATH%" > NUL: 2>&1
copy /v "%APPCFGPATH%\CentralAppConfig.ini" "%APPBKUPPATH%\CentralAppConfig.ini.%CCTIME%"
copy /v "%APPCFGPATH%\HolterAppConfig.ini" "%APPBKUPPATH%\HolterAppConfig.ini.%CCTIME%"
copy /v "%APPCFGPATH%\RemoteAppConfig.ini" "%APPBKUPPATH%\RemoteAppConfig.ini.%CCTIME%"

goto FIN

:SETTIMEVARS
  for /f "tokens=1* delims= " %%a in ('date/t') do set dayname=%%a
  for /f "tokens=2* delims= " %%a in ('date/t') do set mmddyyyy=%%a
  for /f "tokens=1* delims=/" %%a in ('echo %mmddyyyy%') do set month=%%a
  for /f "tokens=2* delims=/" %%a in ('echo %mmddyyyy%') do set day=%%a
  for /f "tokens=3* delims=/" %%a in ('echo %mmddyyyy%') do set year=%%a
  for /f "tokens=1* delims=:" %%a in ('echo %time%') do set hour=%%a
  for /f "tokens=2* delims=:" %%a in ('echo %time%') do set mins=%%a
  for /f "tokens=3* delims=:" %%a in ('echo %time%') do set sec=%%a
  for /f "tokens=1* delims=." %%a in ('echo %sec%') do set secs=%%a
  for /f "tokens=2* delims=." %%a in ('echo %sec%') do set mili=%%a
  if %hour% lss 10 set hour=0%hour%

  REM create an environment variable which includes date time stamp.
  set CCTIME=%year%%month%%day%_%hour%%mins%%secs%
GOTO :EOF

:FIN
endlocal
Exit