brain ache on this relativey simple relevance, need help if possible …
i need to be able to return multiple results, the following example halts after the first file detected.
i also need a way to add some error checking for name, size, modification time, pathname incase none of those attributes exists on a file?
Any help appreciated.
Single query
q: if exists file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & size of it as string & " | " & modification time of it as string & " | " & pathname of it as string) of file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else “N/A”
q: if exists file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & size of it as string & " | " & modification time of it as string & " | " & pathname of it as string) of file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else “N/A”
q: if exists file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & size of it as string & " | " & modification time of it as string & " | " & pathname of it as string) of file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else if exists file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & size of it as string & " | " & modification time of it as string & " | " & pathname of it as string) of file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else “N/A”
making progress, but still need help with returning multiple results please
q: if exists file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & (if (exists version block 1 of it and exists value “FileDescription” of version block 1 of it) then (value “FileDescription” of version block 1 of it) else (“Unknown”)) & " | " & (if (exists version block 1 of it and exists value “FileVersion” of version block 1 of it) then (value “FileVersion” of version block 1 of it) else (“Unknown”))& " | " & (if (exists size of it) then (size of it as string) else (“Unknown”)) & " | " & (if (exists modification time of it) then (modification time of it as string) else (“Unknown”))& " | " & (if (exists pathname of it) then (pathname of it as string) else (“Unknown”))) of file “BESClientUI.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else “N/A”
q:if exists file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) then (name of it & " | " & (if (exists version block 1 of it and exists value “FileDescription” of version block 1 of it) then (value “FileDescription” of version block 1 of it) else (“Unknown”)) & " | " & (if (exists version block 1 of it and exists value “FileVersion” of version block 1 of it) then (value “FileVersion” of version block 1 of it) else (“Unknown”))& " | " & (if (exists size of it) then (size of it as string) else (“Unknown”)) & " | " & (if (exists modification time of it) then (modification time of it as string) else (“Unknown”))& " | " & (if (exists pathname of it) then (pathname of it as string) else (“Unknown”))) of file “BESClient.EXE” of folder “BigFix Enterprise\BES Client” of folder (value of variable “ProgramFiles” of environment) as string else “N/A”
Not sure what your final desire might be but you do know you can just have the application inspector pump out a lot of that information for you? Going after the version blocks as you are isn’t needed.
And this would probably be much simpler (with some sample values):
q: (it as string & " | " & size of it as string & " | " & pathname of it & " | " & modification time of it as string) of application “C:\Program Files (x86)\BigFix Enterprise\BES Client\BESClientUI.exe”
You can combine the two file checks with plural inspectors and use the “|” operation to check for errors:
q: (name of it & "|" & ((size of it as string) | "ERR") & "|" &((modification time of it as string) | "ERR" ) & "|" & pathname of it) of files ("BESClientUI.exe"; "BESClient.exe") of folder "BigFix Enterprise\BES Client" of folder (value of variable "ProgramFiles" of environment) as string
A: BESClientUI.exe|1471896|Mon, 05 Dec 2011 18:49:22 -0800|C:\Program Files (x86)\BigFix Enterprise\BES Client\BESClientUI.exe
A: BESClient.exe|4678552|Mon, 05 Dec 2011 18:49:22 -0800|C:\Program Files (x86)\BigFix Enterprise\BES Client\BESClient.exe