Community FAQ
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Saraee
Engaged Sweeper II
I need to identify all computers that have a certain file under Program Files. Because we have both 32 and 64 bit computers, I included 2 files to search for, example:

%program files%\Common Files\Filea.lic
%program files (x86)\Common Files\Filea.lic

The problem is that on a 32 bit machine with the file C:\Program Files\Common Files\Filea.lic, Lansweeper shows as a match for both of the file searches, hence 2 files found when there is only one. When I run a report it shows 2 entries (matches) for this computer with only one file.

If I only run the search for %program files%\Common Files\Filea.lic, it fails to find the file on 64 bit machines with the true path of C:\Program Files (x86)\Commonm Files\Filea.lic.

Any suggestion on how I can prevent a false positive for "program files" when the variable is "%program files (x86)%"?

Thanks!
3 REPLIES 3
Saraee
Engaged Sweeper II
Perfect! I just tested this and it works as expected. Thank you!
Hemoco
Lansweeper Alumni
You only need the file scan below, which redirects to c:\Program Files\Common Files\Filea.lic on 32-bit machines. You must submit the %programfiles(x86)% parameter exactly as shown below. Note the two percent signs and the lack of spaces in the parameter.
%programfiles(x86)%\Common Files\Filea.lic
RCorbeil
Honored Sweeper II
If you're just looking for FileA.lic, regardless of where it's found, you could probably do something like
Where
( Select
Count(*)
From
tblFileVersions As v
Where
v.Found = 1 -- found...
AND v.FilePathfull Like '%\FileA.lic' -- ...the file we're looking for
AND v.AssetID = tblAssets.AssetID -- ...on the machine we're looking at
) <> 0 -- 1 or more matches found! Bingo!

Archive

This board contains archived posts from the retired Lansweeper Forum and Insiders Community.

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now