Scripting – Push OpenFire Spark Client spark.properties file to multiple machines
The batch script below can be used to copy the spark.properties for the OpenFire Spark IM Client file over to new machines on startup/logon. The batch script will copy/create the necessary structure on both Windows 7 and Windows XP machines.
@echo off cls :: set the location of the spark.properties file set sparkLocation=\\server.contoso.com\software$\spark.properties :: determine OS version ver | findstr /i "5\.1\." > nul IF %ERRORLEVEL% EQU 0 GOTO ver_XP ver | findstr /i "6\.1\." > nul IF %ERRORLEVEL% EQU 0 GOTO ver_Win7 :ver_Win7 :: windows 7, check to see if properties file exists IF EXIST %HOMEPATH%\AppData\Roaming\Spark\spark.properties GOTO alreadyThere7 IF NOT EXIST %HOMEPATH%\AppData\Roaming\Spark\spark.properties GOTO notThere7 GOTO end :alreadyThere7 :: already there, copy over copy /Y %sparkLocation% %HOMEPATH%\AppData\Roaming\Spark\spark.properties goto end :notThere7 :: not there, make directory and copy over md %HOMEPATH%\AppData\Roaming\Spark copy /Y %sparkLocation% %HOMEPATH%\AppData\Roaming\Spark\spark.properties goto end :ver_XP :windows xp check to see if file exists IF EXIST %USERPROFILE%\Local Settings\Application Data\Spark\spark.properties GOTO alreadyThereX IF NOT EXIST %USERPROFILE%\Local Settings\Application Data\Spark\spark.properties GOTO notThereX GOTO end :alreadyThereX :: already there, copy over copy /Y %sparkLocation% %USERPROFILE%\Local Settings\Application Data\Spark\spark.properties goto end :notThereX :: not there, make directory and copy over md %USERPROFILE%\Local Settings\Application Data\Spark\spark.properties copy /Y %sparkLocation% %USERPROFILE%\Local Settings\Application Data\Spark\spark.properties goto end :end