NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Search for file names with Engine.SearchFiles?

Solved!
Go to solution

I posted my comment to a solved thread: http://forums.ni.com/t5/NI-TestStand/searchfiles/td-p/2364238/page/2 

and I haven't got a solution. So I post it now in a new thread.

 

Is it possible to search for substring in a file name useing the Engine.SearchFiles method? I know, that there is a SearchOptions_RegExpr, but I could not figure out, how to search for file names. I can find files, which contain particular expressions, variables etc. but not file names.

 

So, is it anyhow possible?

0 Kudos
Message 1 of 4
(3,409 Views)

Do you mean that you want file files with a particular name, or that you want to find particular file names used within a file? Those are two very different things. If you just want to find files with a particular name why not just use Windows file explorer?

 

-Doug

0 Kudos
Message 2 of 4
(3,403 Views)

Hi Doug,

 

I just want to find particular file names. But I want to do it programmatically, so I can't use the windows explorer. Or is there any trick to use that without user interaction???

 

Madottati

0 Kudos
Message 3 of 4
(3,400 Views)
Solution
Accepted by topic author Madottati

SearchFiles is only for searching within files. Take a look at the FindFiles sequence in:

 

<TestStand>\Components\Tools\ForEach.seq

 

This sequence searches for all files under a directory tree using direct calls to the WIN32 APIs. You could probably just call this sequence directly to do what you are asking.

 

-Doug

0 Kudos
Message 4 of 4
(3,393 Views)