
Originally Posted by
Hightower
So Bossman gave me the solution to a problem we're having with Symantec, and rather than run the solution manually on the machines as and when they suffer the problem (as it takes about 10 minutes) I thought I'd put it in a batch file to do it for me.
It's about done, but I need two things adding to my batch file:
1) Delete all folders (and files within them) from C:\Program Files\Common Files\Symantec Shared\VirusDefs where the folder name matches ????????.??? (where ? is a single wild card character)
2) Delete all folders (and files within them) from C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\I2_LDVP.VDB
The trouble I'm having is that you cannot use wild card characters in a batch file command such as RMDIR or RD. I think the way to do this would be with a loop, but I'm not sure where to start so any help would be appreciated.
Thanks,

Don't have SAV but this looks relatively simple - just to clarify
(1), is there always only a single folder under VirusDefs that you wish to remove and no other files in the root VirusDefs folder, or are there multiple files in there and you want to specify a specific filename when running the batch to remove only one file?
(2) Is I2_LDVP.VDB the folder name? If you want everything gone from under it, can you do it the lazy way and just
Code:
rd /s /q I2_LDVP.VDB (Remove I2_LDVP.VDB and all subfolders, no prompting)
md I2_LDVP.VDB (Recreate I2_LDVP.VDB)
or is this locked while SAV is running? If you need to do it in a loop, it should be
Code:
del /q "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\I2_LDVP.VDB\*"
for /D %%I in (C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\I2_LDVP.VDB\*) do RD /s /q "C:\Documents and Settings\All Users\Application Data\Symantec\Symantec AntiVirus Corporate Edition\7.5\I2_LDVP.VDB\%%I"