Find-like script for windows I always read questions about a Windows solution to find a file in a directory structure like find and grep.
I created this working c++ program, where you give the program a path and a file name to find.
#include &lt;iostream&gt;
#include &lt;string&gt;
#include &lt;sys/stat.h&gt;
#include &lt;windows.h&gt;

#ifndef INVALID_FILE_ATTRIBUTES
constexpr INVALID_FILE_ATTRIBUTES((DWORD) - 1)
#endif

BOOL IsDir(const std::string &amp;path)
{
DWORD Attr;

Attr = GetFileAttributes(path.c_str());
if (Attr == INVALID_FILE_ATTRIBUTES)
    return FALSE;

return (BOOL)(Attr &amp; FILE_ATTRIBUTE_DIRECTORY);
}

std::string sanitizePath(const std::string &amp;path)
{
std::string fspath = path;

while (*(fspath.rbegin()) == '/' || *(fspath.rbegin()) == '\\')
    fspath.pop_back();

return fspath;
}

int findFiles(std::string &amp;fspath, const std::string &amp;fs)
{
static size_t i = 0;
WIN32_FIND_DATA FindFileData;

std::string destpath = fspath + std::string(&quot;\\*.*&quot;);

HANDLE hFind = FindFirstFile(destpath.c_str(), &amp;FindFileData);

if (hFind != INVALID_HANDLE_VALUE)
    do {
        std::string fullpath = std::string(fspath) + std::string(&quot;\\&quot;) + std::string(FindFileData.cFileName);

        if (*(fullpath.rbegin()) == '.')
            continue;
        else if (FindFileData.dwFileAttributes &amp;FILE_ATTRIBUTE_DIRECTORY)
            findFiles(fullpath, fs);
        else
        {
            if (FindFileData.cFileName == fs)
            {
                std::cout &lt;&lt; fs &lt;&lt; &quot; was found in -&gt; &quot; &lt;&lt; fspath &lt;&lt; std::endl;
                i++;
            }
        }
    } while (FindNextFile(hFind, &amp;FindFileData));

FindClose(hFind);
return i;
}

int main(int argc, char **argv)
{
if (argc &lt;= 2)
{
    std::cerr &lt;&lt; &quot;No path or filename provided&quot; &lt;&lt; std::endl;
    return EXIT_FAILURE;
}

const char *path = argv[1];
const char *fileSearched = argv[2];

if (!IsDir(path))
{
    std::cerr &lt;&lt; &quot;Path doesn't exist&quot; &lt;&lt; std::endl;
    return EXIT_FAILURE;
}

std::string fspath = sanitizePath(path);
std::string fs = fileSearched;

std::cout &lt;&lt; &quot;Searching &quot; &lt;&lt; fspath &lt;&lt; &quot; and its subdirectories&quot; &lt;&lt; std::endl;

int i = findFiles(fspath, fs);

if (i == 0)
    std::cout &lt;&lt; fs &lt;&lt; &quot; was not found in &quot; &lt;&lt; fspath &lt;&lt; &quot; or its subdirectories&quot; &lt;&lt; std::endl;
else if (i == 1)
    std::cout &lt;&lt; fs &lt;&lt; &quot; was found once&quot;;
else
{
    std::cout &lt;&lt; fs &lt;&lt; &quot; was found &quot; &lt;&lt; i &lt;&lt; &quot; times&quot; &lt;&lt; std::endl;
    std::cout &lt;&lt; &quot;Beware same filename does NOT automatically mean same file content.&quot; &lt;&lt; std::endl;
}

return EXIT_SUCCESS;
}

it is used like this
find &lt;path&gt; &lt;filename&gt;

It is case sensitive and gives you whether and where the file was found and how many times.
I used an online code beautifier for indentation.
The sanitize method is for removing trailing &quot;/&quot; or &quot;\&quot;.
It compiled and ran to multiple tests.
Please give me you opinions especially about its professionalism aka do code in big companies look like that?
Keep in mind, I graduated some time and failed so far in getting internship or a job in programming in my country.
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;
 }