Get a filename in a fixed path (say “C:\prog”), beginning with fixed string (say “myversion_v”
Return the part of the filename starts with “v”
Tried:
names of files whose (name of it starts with “myversion_v”) of folder “C:\prog”
Problems
When I try to use “substring” on it, it fails, because of different object types (set of strings not working with substrings command).
When I try to use “name of first file whose…”, fails, error “first file” not defined.
When I try to define a temporary variable with the command “let”, it seems not working for some reason, but can be that I missed some syntax requirements.
Maybe you will reach the goal from an entirely different approach Keen on hearing/reading.
names of find files "myversion_*" of folder "c:\prog"
OR this for file checking
if (number of names of find files "myversion_*" of folder "c:\prog" = 0) Then "Not Detected" Else names of find files "myversion_*" of folder "c:\prog"
The relevance I put works for us, we use it in an analysis to find all BigFix installers on the netlogon folder.
if (number of names of find files "BigFix*" of folder ((path of it) of network share whose (name of it as string as lowercase = "netlogon" as string as lowercase) & "\patchagent") = 0) Then "Not Detected" Else (names of files whose(name of it as lowercase starts with "BigFix" as lowercase AND name of it ends with ".exe") of folder ((path of it) of network share whose (name of it as string as lowercase = "netlogon" as string as lowercase) & "\patchagent"))
I used this to test for the relevance I put in my first response.