I need some help trying to pull the version of SAV. Here is what I have so far, and it it works, but I need to add a second folder that rtvscan.exe can reside in (program files\symantec\symantec endpont protection) :
if (exists folder ((value of variable “ProgramFiles” of environment) & “\Symantec AntiVirus”) whose (exists file “Rtvscan.exe” of it)) then ((version of file “Rtvscan.exe” of folder ((value of variable “ProgramFiles” of environment) & “\Symantec Antivirus”)) as string) else “SAV not installed”
I’ve tried these 3 codes and none of them give me 100% results:
if (exists folder ((value of variable “ProgramFiles” of environment) & “\Symantec AntiVirus”) whose (exists file “Rtvscan.exe” of it)) then ((version of file “Rtvscan.exe” of folder ((value of variable “ProgramFiles” of environment) & “\Symantec Antivirus”)) as string) else “SAV not installed”
regapps whose (value “FileDescription” of version block 1 of it as lowercase contains “symantec”)
if (exists regapp “vpc32.exe”) then (version of regapp “vpc32.exe” as string) else “SAV not installed”
Since you said that rtvscan.exe can live in two different directories on your boxes the first one you listed won’t give you 100% results.
Here are a couple of variations on the theme (my rtvscan.exe does not live in either of the directories you specify). The first one is much “lighter” when running, relative to the second:
q:
if (exists folder (value of variable
"ProgramFiles" of environment &
"\Symantec Antivirus") whose (exists file
"Rtvscan.exe" of it)) then (version of file
"Rtvscan.exe" of folder (value of variable
"ProgramFiles" of environment &
"\Symantec Antivirus") as string)
else (
if (exists folder (value of variable
"ProgramFiles" of environment &
"\Symantec\Symantec Antivirus") whose (exists file
"Rtvscan.exe" of it)) then (version of file
"Rtvscan.exe" of folder (value of variable
"ProgramFiles" of environment &
"\Symantec\Symantec Antivirus") as string)
else (
"SAV not installed.")) A: SAV not installed. T: 0.328 ms I: singular string q:
if (exists descendants whose (name of it =
"Rtvscan.exe") of folders whose (first 8 of name of it as lowercase =
"symantec") of folder (value of variable
"ProgramFiles" of environment)) then (versions of descendants whose (name of it =
"Rtvscan.exe") of folders whose (first 8 of name of it as lowercase =
"symantec") of folder (value of variable
"ProgramFiles" of environment) as string)
else (
"SAV not found.") A: 10.1.6.6000 T: 36.255 ms I: plural string
q: if exists folder (value of variable “ProgramFiles” of environment & “\Symantec AntiVirus”; value of variable “ProgramFiles” of environment & “\Symantec\Symantec Endpont Protection”) whose (exists file “Rtvscan.exe” of it) then version of file “Rtvscan.exe” of (folder (value of variable “ProgramFiles” of environment & “\Symantec AntiVirus”); folder (value of variable “ProgramFiles” of environment & “\Symantec\Symantec Endpont Protection”)) as string else “SAV not installed”
**This one actually requires that both directories exist, but not necessarily the files. If they don’t or you’re unsure, then use pmullins’ relevance above.