"dir/s/b" Command Prompt not picking-up all the files in a directory.

galen_burnett_7 1 Reputation point
2024-03-03T12:49:41.28+00:00

I'm using the command in Command Prompt that goes "[a directory] > dir/s/b > [to a text-file]". Basically I'm trying to get a file-inventory of the entire OS: I'm doing this because I'm about to Clean-Install and I just want to check I haven't saved a file away in a remote directory without meaning to and then forgotten about it; also I want to better understand the OS, and getting such an inventory will enable me to make a kind-of visual map of the OS, i.e., I'll make a tree-diagram with shapes representing the directories and in proportion to their sizes.

When applying this command to certain folders in the Windows OS—

"C:\Users\Administrator"

"C:\ProgramData\Packages"

"C:\Windows\ServiceState"

in particular—

it doesn't manage to get the file-paths for some of the files. There will be a discrepancy between the file-folder total in the folder's Properties and the number of entries exported by that Command Prompt command. I notice that in the case of "C:\Windows\ServiceState" many of the missing entries are for files with the ".cache" file-extension.

Also, the file

"C:\Windows\SystemTemp\MpCmdRun-35-53C9D589-6B66-4F30-9BAB-9A0193B0BAFC.lock"

does not get registered as an entry when using this same Command Prompt command on the directory

"C:\Windows\SystemTemp".

Also, please note that in my File Explorer Settings I have "Show hidden files, folders, and drives" checked; and I have "Hide protected operating system files (Recommended)" unchecked, for the time-being.

Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. galen_burnett_7 1 Reputation point
    2024-03-03T13:50:20.7733333+00:00

    This was answered for me in a different forum. Can't see any option to remove the post.

    The answer is to use "dir/a/b/s" rather than just "dir/s/b". Don't know why.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.