I am trying to get the list of all folders and files (including hidden and operating system files) within a drive. I cannot loop it as each folder has different depth. Is there any command in cmd that lets us see each file and folder within a drive with their absolute paths provided? Thanks.
Asked
Active
Viewed 40 times
0
-
1tried `os.walk`, `glob.glob`? – Lei Yang Feb 08 '22 at 03:15
-
On *nix, the `tree` command does this. edit: oh. `tree` is/was a DOS command. Does it suit your needs? It'd be `tree /f` – Jack Deeth Feb 08 '22 at 03:16
-
you most certainly can loop. lots of ways to handle depths including recursion. – Abel Feb 08 '22 at 03:18
-
Does this answer your question? [How do I list all files of a directory?](https://stackoverflow.com/questions/3207219/how-do-i-list-all-files-of-a-directory) – ti7 Feb 08 '22 at 03:25
1 Answers
1
In the Windows command prompt, you could try tree /f
.
However this might not include hidden files.

Jack Deeth
- 3,062
- 3
- 24
- 39
-
(sorry, away from my Windows machines right now so can't check for myself) – Jack Deeth Feb 08 '22 at 03:23
-
thanks for your answer, I found my solution for the problem with .walk() – Pranav Krishna S Feb 08 '22 at 07:23