Hello,
I am looking for a way to check two different paths for the same file.
for example I have a script that looks for a file called pccnt.exe on
the entire computer and then runs the trend micro install program if
it does not find that file.
But I would like to speed this up since I already know that the file I
am looking for is always in C:\Program Files\Trend Micro\Officescan
client\ or in D:\Program Files\Trend Micro\Officescan client\.
I would like to know how to tell the script to check the C: path and
the D: path for this file and then run the install program if it does
not find it on either drive, however if it does find this file on D:
or on C: then to just quit.
Here is the script I am running now, and although it works great. It
seems to be slowing down log on time for some of my users.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root
\cimv2")
Set colFiles = objWMIService.ExecQuery _
("Select * From CIM_Datafile Where FileName = 'pccnt' and
Extension = 'exe'")
Set objShell = CreateObject("Wscript.Shell")
If colFiles.Count > 0 Then
Wscript.Quit
Else
On Error Resume Next
objShell.Run "\\MYSERVERNAME\ofcscan\install_trend.cmd"
End If
Thanks for your input.