I have modified your script for my own use which may help others out as well so thought i would post it.
It will automaticly find if the client is installed in the program files (x86) folder, or in the \symantec antivirus\ folder, as well as automaticlly grabbing the sylink.xml file from a remote server and creates a log of it's activity.
The benifit of this method over many others is that IT IS INVISIBLE TO THE CLIENTS, that is, the end user will not notice that the server has changed. The only thing that they may notice is the shield will go away for a short period of time and then come back, that is all - no cmd screens flashing up showing pings etc.
Thanks to the original author for putting this together.
Needs administrator (or admin user) username/password to grab the file from the remote server.
Make a new batch file in the same directory as the original files (that you downloaded in the zip from the original author) and copy an paste the script below into it. No need to run copy.bat first.
Run using: psExec.exe @clients.txt -u DOMAIN\username -p password -c script.bat
@echo off :SYMANTEC echo. echo SEP-Client interface is stopping... echo.
if exist "%programfiles%\symantec\symantec endpoint protection\smc.exe" goto :NEW
if exist "%programfiles%\symantec antivirus\smc.exe" goto :OLD
if exist "%programfiles(x86)%\symantec\symantec endpoint protection\smc.exe" goto :64Bit
:64Bit echo. echo -----------------64bit INSTALL----------------- >> \\servername\andpath.log echo %computername% >> \\servername\andpath.log echo. "%programfiles(x86)%\symantec\symantec endpoint protection\smc.exe" -stop REM ## PING is used as delay since SMC.EXE takes some seconds to stop REM ## but after running the command you have immediatly the prompt back
ping -n 20 127.0.0.1
echo. echo Making a backup copy of previous Sylink.xml in Sylink.xm_ echo.
del /Q "%programfiles(x86)%\symantec\symantec endpoint protection\SyLink.xm_" del /Q "%programfiles(x86)%\symantec\symantec endpoint protection\sylink.xm_bak" ren "%programfiles(x86)%\symantec\symantec endpoint protection\SyLink.xml" sylink.xm_bak del /Q "%programfiles(x86)%\symantec\symantec endpoint protection\SyLink.xml"
echo. echo Copying new SyLink.xml to symantec endpoint protection echo. xcopy \\servername\andpath\sylink.xml "c:\program files (x86)\symantec\symantec endpoint protection\" /Y /R /H echo Starting SEP-Client interface... "%programfiles(x86)%\symantec\symantec endpoint protection\smc.exe" -start echo. echo ----------------DONE----------------- >> \\servername\andpath.log echo. goto :eof
:OLD echo. echo ----------------OLD INSTALL---------------- >> \\servername\andpath.log echo %computername% >> \\servername\andpath.log echo. "%programfiles%\symantec antivirus\smc.exe" -stop
REM ## PING is used as delay since SMC.EXE takes some seconds to stop REM ## but after running the command you have immediatly the prompt back
ping -n 20 127.0.0.1
echo. echo Making a backup copy of previous Sylink.xml in Sylink.xm_ echo.
del /Q "%programfiles%\symantec antivirus\SyLink.xm_" del /Q "%programfiles%\symantec antivirus\SyLink.xm_bak" ren "%programfiles%\symantec antivirus\SyLink.xml" sylink.xm_bak del /Q "%programfiles%\symantec antivirus\SyLink.xml"
echo. echo Copying new SyLink.xml to symantec antivirus echo. xcopy \\servername\andpath\sylink.xml "c:\program files\symantec antivirus\" /Y /R /H echo Starting SEP-Client interface... "%programfiles%\symantec antivirus\smc.exe" -start echo. echo ----------------DONE----------------- >> \\servername\andpath.log echo. goto :eof
:NEW echo. echo ----------------NEW INSTALL---------------- >> \\servername\andpath.log echo %computername% >> \\servername\andpath.log echo. "%programfiles%\symantec\symantec endpoint protection\smc.exe" -stop REM ## PING is used as delay since SMC.EXE takes some seconds to stop REM ## but after running the command you have immediatly the prompt back
ping -n 20 127.0.0.1
echo. echo Making a backup copy of previous Sylink.xml in Sylink.xm_ echo.
del /Q "%programfiles%\symantec\symantec endpoint protection\SyLink.xm_" del /Q "%programfiles%\symantec\symantec endpoint protection\sylink.xm_bak" ren "%programfiles%\symantec\symantec endpoint protection\SyLink.xml" sylink.xm_bak del /Q "%programfiles%\symantec\symantec endpoint protection\SyLink.xml"
echo. echo Copying new SyLink.xml to symantec endpoint protection echo. xcopy \\servername\andpath\sylink.xml "c:\program files\symantec\symantec endpoint protection\" /Y /R /H echo Starting SEP-Client interface... "%programfiles%\symantec\symantec endpoint protection\smc.exe" -start echo. echo ----------------DONE----------------- >> \\servername\andpath.log echo. goto :eof