Share via

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

Anonymous
2024-03-01T13:59:49+00:00

I'm using the command in Command Prompt that goes "[a directory] > dir/s/b > [to a text-file]". When applying this 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".

==========================

Please explain both these things.

========================

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.

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. _AW_ 67,216 Reputation points Volunteer Moderator
    2024-03-03T12:13:27+00:00

    Try with dir /a /b /s

    On my W11:

    C:\Windows\System32>dir /a /b /s "C:\Windows\ServiceState\" 
    
    C:\Windows\ServiceState\EventLog 
    
    C:\Windows\ServiceState\HidOverGatt 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc 
    
    C:\Windows\ServiceState\wmansvc 
    
    C:\Windows\ServiceState\EventLog\Data 
    
    C:\Windows\ServiceState\EventLog\Data\lastalive0.dat 
    
    C:\Windows\ServiceState\EventLog\Data\lastalive1.dat 
    
    C:\Windows\ServiceState\HidOverGatt\Data 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\146468388.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\1495831526.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\1507916744.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\1741027327.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\2267548268.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\3177265390.cache 
    
    C:\Windows\ServiceState\WinHttpAutoProxySvc\Data\cachev3.dat
    
    3 people found this answer helpful.
    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-03-03T13:47:52+00:00

    @_AW_ Thanks a lot! yes that's done it. How peculiar that "[...]/a[...]" should make such a difference.

    0 comments No comments
  2. Anonymous
    2024-03-03T11:41:16+00:00

    Thanks for telling me about that forum I hadn't heard of before. I'll have a look.

    0 comments No comments
  3. Anonymous
    2024-03-02T09:28:06+00:00

    Hello,galen_burnett_7

    Thank you for posting in the Microsoft community.

    Thank you for your interest in the use of Microsoft systems, but you are inquiring about specific runtime logic in the command prompt related issues are beyond the scope of our forum support, our community to provide technical support on the daily use of Windows Home and Professional and upgrade and update faults, on the issues you mentioned it is more appropriate to post in Microsoft Learn (English only, you can use the translation tool to assist communication), the board is intended for advanced users like you to provide services. It is more appropriate to post your question in Microsoft Learn (English only, you can use a translation tool to help you communicate), which is intended for advanced users like you.

    You can ask a question by clicking on "Ask a question", where there are experts in the field who can provide more specialised solutions.

    I won't be able to help you, but I'll keep the question on file in case one of our wonderful volunteers comes up with something for you.

    Best Regards,

    Rota Ye |Microsoft Community Support Specialist

    0 comments No comments