title: C:\ file scan with C++, access denied to specific files
body: <p>Ok so I have written a code with recursive function that scans my (or any other) C:\ disc. 
  Using chdir() I'm changing the active directory to C:\ and using system("dir >> C:\Test\"filename") to get the files in that directory written in .txt and then reading it to know what I have. After that I'm checking for additional directories with <code>temp.substr("&lt;DIR&gt;")</code> and calling the function again just with longer path for that specific directory.</p>
  
  <p>The code itself works as it should but I've ran to some directories that I can't access such as Administrator or specific folders in Windows. The only way I've found around them is by adding exeptions to the code so that it just avoids those folders. I'd like to know if there is a way to get a list of folders/files that I don't have access to from cmd since it would make my code a lot more precise or a way to access those directories.</p>