(imported comment written by JasonWalker)
I don’t have exactly the same file structure as you, but these examples should help you get started:
q: (pathnames of it, modification time of it) of files whose (now - modification time of it < 1 * day) of folder “c:\windows\temp”
A: c:\windows\temp\chrome_installer.log, ( Sat, 13 Sep 2014 04:34:01 -0500 )
A: c:\windows\temp\MpCmdRun.log, ( Sat, 13 Sep 2014 04:39:43 -0500 )
A: c:\windows\temp\MpSigStub.log, ( Fri, 12 Sep 2014 15:57:50 -0500 )
A: c:\windows\temp\ScheduledHeartbeat.log, ( Sat, 13 Sep 2014 07:06:56 -0500 )
T: 2.500 ms
You can build an Appendfile by concatenating the results with the CR/LF characters “%0d%0a”…
delete __appendfile
appendfile {concatenation “%0d%0a” of (“del /q %22” & it & “%22”) of (pathnames of it) of files whose (now - modification time of it < 1 * day) of folder “c:\windows\temp”}
delete “delete_old_files.cmd”
move __appendfile delete_old_files.cmd
waithidden cmd /c delete_old_files.cmd
Also, in Win7/Win8 there’s a registry key to tell you where the Profiles are. Check whether this is also available on XP and it might save you a few more statements / duplications:
q: expand environment string of (value “ProfilesDirectory” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList” of native registry as string)
A: C:\Users
If that doesn’t work, you could put your hardcoded values right in the Relevance as well…as I said I don’t have your file structures but see if either of these gets what you’re looking for…
q: concatenation “%0d%0f” of (“del /q %22” & it & “%22”) of (pathnames of it) of files whose (name of it starts with “test_” and now - modification time of it < 1 * day) of descendant folders of folder (if name of operating system = “Win7” then “c:\users” else “c:\documents and settings”)
Now, the following gives me an error, I think because some of the folder names under Users can’t be evaluated by BigFix (folder lengths or directory junctions may be confusing it), but if you can avoid scanning all subdirectories and limit the search to certain paths like “Documents” or “Desktop” you may get some mileage out of
q: concatenation “%0d%0f” of (“del /q %22” & it & “%22”) of (pathnames of it) of files whose (name of it starts with “test_” and now - modification time of it < 1 * day) of descendant folders of folder ((expand environment string of (value “ProfilesDirectory” of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList” of native registry as string)))
E: The expression could not be evaluated: class IllegalFileName