Hi @Varun
Step 1: Create a Task to generate the list of files
In the TEM Console, select the menu option “Tools”, then “Create New Task Message”
In the “Name” field type in a title such as “Task to find .txt files”
In the “Message:” field put in a description of the task, such as “This task will search the drive for text files and then write them to the file “textfiles.txt” in the client folder. The action will only run when you apply the task to a computer”
In the “Action” tab, make sure the “Action Script Type” is “BigFix Action Script” and in the “Action Script” field paste the following:
delete __appendfile
delete findtextfiles.bat
appendfile @echo off
appendfile del “{pathname of parent folder of regapp “BESClient.exe”}\textfiles.txt”
appendfile echo “{”" & concatenation "" of pathnames of descendants whose (name of it as lowercase ends with “.txt”) of folders “” of drives whose (type of it=“DRIVE_FIXED”) & “**”}" >> “{pathname of parent folder of regapp “BESClient.exe”}\textfiles.txt”
move __appendfile findtextfiles.bat
wait “{pathname of client folder of site “BESSupport”}\RunQuiet.exe” findtextfiles.bat 1>NUL 2>NUL
On the “Relevance” tab, remove any text such as “true” and replace with the following:
version of regapp “BESClient.exe” >= “5.1”
You now have a Task that will search the drive for text files and then write them to the file “textfiles.txt” in the client folder. The action will only run when you apply the task to a computer. Any computer that you apply this task to will return the path of the .txt file.
This task will report back “Failed” on computers that do not have text files on the disk drives. You can safely ignore this report.
Note: Avoid having this task run continuously, since it is very resource intensive, and local users will probably notice the disk access. You can, for example, have this task constrained to run when no user is present to minimize its impact.
Step 2: Create a Retrieved Property
Select the menu “Tools” then “Manage Properties”
Click the “Add New” button.
In the “Name:” field enter something like “TEXT files”. In the “Relevance” field enter the following:
if exists file “textfiles.txt” of parent folder of regapp “BESClient.exe” then if size of file “textfiles.txt” of parent folder of regapp “BESClient.exe” > 10 then (substrings between “**” of (lines of file “textfiles.txt” of parent folder of regapp “BESClient.exe”)) else “N/A” else “No TEXT files”
Regards
Vicky