SQL Query : Find .exe in a particular file path

This query will return all machines where an exe is found in a specific file path.  The advantage of using this is so that you don’t return all machines simply containing the file.  This (should) mean the software is actually installed.

 select computer_system_data.name00, computer_system_data.username00, SoftwareFile.filename, SoftwareFile.FileVersion, softwarefilepath.filepath
 FROM computer_system_data, SoftwareFile, softwareinventory, workstationstatus_data, softwarefilepath
 WHERE computer_system_data.machineId = softwareinventory.clientid
 and softwareinventory.fileid = softwarefile.fileid
 and softwareinventory.filepathid = softwarefilepath.filepathid
 and SoftwareFile.filename = 'outlook.exe'
 and computer_system_data.machineid = workstationstatus_data.machineId
 and softwarefilepath.filepath like 'C:\PROGRAM FILES\MICROSOFT OFFICE 15\root\office15\'
 Order by name00

Sample Output

Related posts

Leave a Comment