|
Answer» Hi Im looking to create a txt file which contains a list of all FILES located in a folder directory.
I currently use the following script in a .BAT file.
But I just require it to display a list of files located and not system info.
I also want to be able to apply it to various folders, not just files on c:drive
@dir %1 /A /S > c:\dirListing.txt @echo OPENING c:\dirListing.txt in Notepad @notepad c:\dirListing.txt @echo Deleting c:\dirListing.txt @del c:\dirListing.txt @pauseI can't remember what the A switch does, but the B switch is "bare format", meaning only names (or names and paths with the S switch).
If you want to do a different folder, the whole command would be (using your chosen switches) Dir [foldername] /a /b /s
You have it so this batch file is best run off the command prompt because it IMPLEMENTS %1. That means that the first word you put after the batch NAME becomes part of the script. So to do it that way, drag and drop the batch file (after adding the B switch between the A switch and the S) and type the folder you want to run the directory script on (remember to add path!)
|