@@echo off SET TOOLDIR=.\cmsbatch\Tools REM Accepted Parameters REM 1 - server external name/address REM 2 - server internal name/address REM 3 - server port REM 4 - server site name REM 5 - ASCII, comma-separated values (csv) file REM 6 - user name [optional] REM 7 - user password [optional] REM 8 - encoding [optional] REM Disabled Parameters REM 8 - e-mail address list [optional] (space-separated list) REM Verify all required parameters are present. if "%1"=="" goto :_usage if "%2"=="" goto :_usage if "%3"=="" goto :_usage if "%4"=="" goto :_usage if "%5"=="" goto :_usage REM Get current time and date fields, which are stored in global variables set weekday_= set day_= set month_= set year_= set hour_= set minute_= set second_= REM Create a non-conflicting temporary file used by 'getdate' and 'gettime' REM by using the site name and the CSV file name in the temporary file name. set temp_="%4_%5_.TMP" @CALL %TOOLDIR%\setwinenv @CALL %TOOLDIR%\getdate @CALL %TOOLDIR%\gettime REM Invoke the RemoveCentraUsers application. .\cmsbatch\jre\bin\jre.exe -cp .;cmsbatch\xerces.jar -Dsymposium.home=cmsbatch\jre -Dctrainet.useragent=msie cmsbatch.RemoveCentraUsers %1 %2 %3 %4 %5 RemoveUsersLog_%month_%_%day_%_%year_%_%hour_%_%minute_%_%second_%.txt %6 %7 %8 REM To enable e-mail of log file, remove following line. goto :_end REM If no e-mail address specified, we're done. if "%8"=="" goto :_end REM Construct the list of email addresses. set emailAddr_=%8% shift :_mailLoop if "%8"=="" goto :_send set emailAddr_=%emailAddr_% %8% shift goto :_mailLoop REM Send the status email. :_send @CALL %TOOLDIR%\sendstatusemail.bat Users RemoveUsersLog_%month_%_%day_%_%year_%_%hour_%_%minute_%_%second_%.txt goto :_end :_usage_with_email echo "Usage: removecentrausers [Centra login ID] [Centra password] [User's email address]" REM Print correct usage instructions. :_usage echo "Usage: removecentrausers [ ] [Character encoding]" :_end