1

I want Power Query to search the entire C: drive to find all files of a particular extension, such as *.pdf. When I try to filter the file extension in the second step I'm getting this error:

DataSource.NotFound: File or Folder: We couldn't find the folder 'C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData\Application Data'.
Details:
    C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData

The problem is, this folder doesn't exist. Why is Power Query returning a folder path that is invalid? The folders being returned by PowerQuery seem to be links to the folders in the C:\ProgramData folder.

The following M script (limited to the problem area) returns 999+ rows on the the first step. If I run dir /s /ah from the same folder from the command prompt, it only returns 20 files.

let
    Source = Folder.Files("C:\Program Files (x86)\Microsoft Office\root\vfs\Common AppData"),
    #"Filtered Rows" = Table.SelectRows(Source, each ([Extension] = ".pdf"))
in
    #"Filtered Rows"

My end goal is use Excel Power Query to find all files of a particular extension on the entire C: drive and return their filename, path, and size. Note that dir c:\*.pdf /b /s > list.txt will not return file sizes.

I have Windows 10 64 bit and Office 365 32-bit installed.

Erik Philips
  • 53,428
  • 11
  • 128
  • 150
Ben
  • 1,168
  • 13
  • 45
  • 1
    That's pretty odd. I can't reproduce the problem, but it seems like there's some kind of indexing cache problem. Does Refresh Preview help at all? – Alexis Olson Aug 03 '18 at 20:30
  • Refresh Preview does not help. I tested on another computer in the office (with fresh image installed) and it has the same issue. It seems like a virtual folder (or something to that effect) is making the scanner think there are subfolders under `Common AppData`. The folders being returned by PowerQuery seem to be links to the folders in the `C:\ProgramData` folder. – Ben Aug 06 '18 at 15:53

0 Answers0