Summary

Our business has over hundreds of Point of Sale payment processing systems in our food and retail venues. It consists of terminals with Point of Sale software and Verifone devices. The Verifone devices have software powered by eSocket and ACI and need to be patched. In order to patch successfully, jar files need to be placed on each terminal and a sequence of services need to be stopped and started. The issue with this is that there is a lot of manual work to perform on each terminal, input jar files in a certain directory, and manually stop and start services in order for it to be patched. The below batch script automates the patching process.

Solution:

cd C:\
net use P: /DELETE
net use P: “Directory of central repository of Jar Patches”

SET /a currentCount = 0
SET /a totalCount = 0
SET /a timerSeconds = 0

dir “p:\jar files\*.jar” | find “File(s)” > c:\verifonePatching\currentCount.txt

FOR /F %%i IN (c:\verifonePatching\currentCount.txt) DO set /a currentCount = %%i
FOR /F %%i IN (c:\verifonePatching\totalCount.txt) DO set /a totalCount = %%i
FOR /F %%i IN (c:\verifonePatching\totalCount.txt) DO set /a timerSeconds = %%i
SET /A “timerSeconds=%timerSeconds%+120”

IF %currentCount% GTR %totalCount% (

echo %currentCount% > c:\verifonePatching\totalCount.txt

ECHO *************************************************
ECHO Patching for EMV – DO NOT QUIT – Waiting for eSocket services to start then stop
ECHO *************************************************

net stop ServiceWatcher /yes
net stop EspRun /yes
net stop EspConfigAgent /yes
net stop EspUpgrManager /yes
robocopy “P:\Jar files” “Directory to put Jar files on terminal” *.jar* /E /is

ECHO *************************************************
ECHO Patching for EMV – DO NOT QUIT – Starting Upgrade
ECHO *************************************************

net start EspUpgrManager

ECHO *************************************************
ECHO Patching for EMV – DO NOT QUIT – Downloading files
ECHO *************************************************

timeout /t %timerSeconds% /nobreak
net stop EspUpgrManager /yes
timeout /t 10 /nobreak
net start EspUpgrManager

ECHO *************************************************
ECHO Patching for EMV – DO NOT QUIT – Starting Config Agent to process files
ECHO *************************************************

timeout /t 10 /nobreak
net start EspConfigAgent

ECHO *************************************************
ECHO Patching for EMV – DO NOT QUIT – Starting all eSocket Services
ECHO *************************************************

timeout /t 10 /nobreak
net start EspRun
sc config ServiceWatcher start= auto
net start ServiceWatcher

)