VOGONS

Common searches


First post, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie

On my PC, I want to index the names of files and folders in a particular location (say the files or folders at "D:\Backups\"), to a text file or any format. Which application should help me do it? I don't have any the name of a program which does this, or is there a Windows function for it?

previously known as Discrete_BOB_058

Reply 2 of 3, by spiroyster

User metadata
Rank Oldbie
Rank
Oldbie

You can use dir command and pipe the output to a file.
Open command prompt, navigate to any dir, then type...

dir /b /s > filelist.txt

To get a list of all files, dirs and subdirs (and files) in a text file called filelist.txt.

See https://docs.microsoft.com/en-us/windows-serv … ws-commands/dir dir command docs for other switches such as file attributes etc. if you want to list that information too. Should even work in pre windows msdos (6.22 etc).

Reply 3 of 3, by BEEN_Nath_58

User metadata
Rank Oldbie
Rank
Oldbie
Boohyaka wrote on 2022-01-09, 10:03:

A simple PowerShell script will do what you want, for example:

get-childitem -path "d:\backups" -recurse | select-object FullName | export-csv "d:\index.csv"

spiroyster wrote on 2022-01-09, 10:53:
You can use dir command and pipe the output to a file. Open command prompt, navigate to any dir, then type... […]
Show full quote

You can use dir command and pipe the output to a file.
Open command prompt, navigate to any dir, then type...

dir /b /s > filelist.txt

To get a list of all files, dirs and subdirs (and files) in a text file called filelist.txt.

See https://docs.microsoft.com/en-us/windows-serv … ws-commands/dir dir command docs for other switches such as file attributes etc. if you want to list that information too. Should even work in pre windows msdos (6.22 etc).

Either of them worked fine, thanks. But is there a way, I can remove the full path and keep the file and folder's indexing.
For eg: I want "Folder X\xyz.txt" instead of "D:\Backups\Folder X\xyz.txt"

previously known as Discrete_BOB_058