Find-like script for windows
As a general rule, I'd tend to prefer the built in C++ bool over the Windows-specific BOOL.

Your sanitizePath seems less than ideal, at least to me. Passing them parameter by reference, then creating a local copy from the reference seems like kind of a waste. If you want a local copy, just pass by value. Regardless of that, std::string already provides a function to search for the position you want, so I'd probably use that.
 std::string sanitizePath(std::string const &amp;input) {
     auto pos = input.find_last_not_of(&quot;/\\&quot;);
     return input.substr(0, pos+1);
 }


After a few decades of using C++, I've gotten to the point that almost any time I see an open and matching close operation, my immediate reaction is to use RAII--define a class that does the open in its ctor, and the matching close in its dtor. It looks to me like file searching fits this pattern, and probably benefits from the RAII treatment.

Likewise, if I'm going to iterate through a collection of objects, my reaction is to think about whether I can define an actual iterator, so I can off-load as much work as possible onto standard algorithms (and such).

I'd avoid using std::endl. In this case, it probably doesn't make a huge difference, but I'd still form the habit of using '\n' when you want a new-line.

You might want to consider using a std::filesystem::recursive_directory_iterator, which already implements an iterator interface for file searching. Using it, the code for findFiles would reduce down to something like this:
 int findFiles(std::filesystem::path const&amp; fspath, const std::string&amp; fs)
 {
     std::filesystem::recursive_directory_iterator di { fspath };
     int count = 0;

     for (auto const&amp; file : di) {
         if (file.path().filename() == fs) {
             std::cout &lt;&lt; file.path().string() &lt;&lt; &quot;\n&quot;;
             ++count;
         }
     }
     return count;
 }