At the office, we are using the Symantec Endpoint Protection (corporate edition) anti-virus solution. One day we realise that every computers running Windows XP Professional in the office is having an issue with low disk space. After a details check-up we found out that the Symantec is storing all the virus definition updates in the “C:\Program Files\Common Files\Symantec Shared\VirusDefs\” folder and it will never gets deleted ! most computers will have at least 20-40GB alone in that folder. The workaround is by using this simple MSDOS batch file to actually delete all the TMP files in that folder.

The MSDOS batch file (or you can call it script) is as below:

cd "C:\Program Files\Common Files\Symantec Shared\VirusDefs\"
for /F "tokens=*" %%G IN ('dir /b /ad "C:\Program Files\Common Files\Symantec 
Shared\VirusDefs\*.tmp"') do RD /S /Q %%G
exit

bare in mind that the “for” statements is in one line. Just use any text editor to create this MSDOS batch file, and give a usefult name like “symantecfix.bat”. save it in one folder under C:\ (for example C:\scripts ).

Some explanation on the scripts. firstly it will actually Change Directory to the “C:\Program Files\Common Files\Symantec Shared\VirusDefs\”, Then it will use the “for” loop to just list out all the *.tmp files in the directory (again here to be safe I include the whole path – just to be sure).


Afterthat once we are in the loop with all the *.tmp files, it will execute the “RD /S /Q filename.tmp” command. RD is a “Remove Directory” (including all the files in the sub-directory), the /S to include the sub-directory, and /Q to skip all the Yes/No question. The %%G is the variable to hold the *.tmp filename – if you were to test this “for” loop at the MSDOS command line (not from the scripts) you should use %G instead. Lastly is the “exit” command – this will just close the MSDOS environment, optional only.

To execute the script, just open the MSDOS window (command “cmd”), change directory to the location of the script file, then type the full filename – in this case symantec.bat, to execute it.

To make it automated, you can use the “Scheduled Task” (from Control Panel). You can make it daily or weekly depend on your preferences.

Have fun.

Tags: , ,

9 Responses to “Workaround for Symantec Endpoint Protection VirusDefs issues”