F5F Stay Refreshed Software Operating Systems Script that records every file name in a directory into a text document

Script that records every file name in a directory into a text document

Script that records every file name in a directory into a text document

C
Ciera7
Member
225
08-08-2020, 12:53 AM
#1
Hello, I noticed needing to gather file names repeatedly and created a script to automate it. Shared for anyone who might need it. Download link provided: https://drive.google.com/file/d/0ByvG-UA...sp=sharing The tool includes two files—"Name Saver.bat" and "pns.exe"—placed in your target folder. Run "Name Saver.bat" and the names will appear in "names.txt" instantly. Example output shown: Finally here is the source code if you're interested: Name Saver.bat - http://puu.sh/d6PUa/4cedc6ecdb.png pns.exe - http://puu.sh/d6PS8/09b6b80890.png
C
Ciera7
08-08-2020, 12:53 AM #1

Hello, I noticed needing to gather file names repeatedly and created a script to automate it. Shared for anyone who might need it. Download link provided: https://drive.google.com/file/d/0ByvG-UA...sp=sharing The tool includes two files—"Name Saver.bat" and "pns.exe"—placed in your target folder. Run "Name Saver.bat" and the names will appear in "names.txt" instantly. Example output shown: Finally here is the source code if you're interested: Name Saver.bat - http://puu.sh/d6PUa/4cedc6ecdb.png pns.exe - http://puu.sh/d6PS8/09b6b80890.png

G
GonzoGamerPro
Junior Member
19
08-15-2020, 05:16 PM
#2
Open a command prompt, navigate to the desired folder, and execute "dir /b /s >names.txt". For a quick list of switches, type "dir /?"
G
GonzoGamerPro
08-15-2020, 05:16 PM #2

Open a command prompt, navigate to the desired folder, and execute "dir /b /s >names.txt". For a quick list of switches, type "dir /?"

Z
Zerpenn
Member
63
08-15-2020, 06:53 PM
#3
I often rely on this when working with sound production plugins, especially when dealing with lengthy directory paths. The "dir /b /s >names.txt" command typically fails because the directory is too long, but it usually functions correctly. EDIT - using "dir /s >names.txt" also tends to capture folder names, which isn't always desirable.
Z
Zerpenn
08-15-2020, 06:53 PM #3

I often rely on this when working with sound production plugins, especially when dealing with lengthy directory paths. The "dir /b /s >names.txt" command typically fails because the directory is too long, but it usually functions correctly. EDIT - using "dir /s >names.txt" also tends to capture folder names, which isn't always desirable.

T
TheBoson123
Junior Member
2
08-16-2020, 02:04 AM
#4
The process feels unusual in length, this hasn't happened before. The longest string I encounter is 223 characters on my system drive, with some odd .dll files scattered across multiple folders. If you don't need those folders, just include the switch "/a:-d". The command line "dir /?" works fine. For a file to run, add "/b /s /a:-d >names.txt" into a batch script and execute it.
T
TheBoson123
08-16-2020, 02:04 AM #4

The process feels unusual in length, this hasn't happened before. The longest string I encounter is 223 characters on my system drive, with some odd .dll files scattered across multiple folders. If you don't need those folders, just include the switch "/a:-d". The command line "dir /?" works fine. For a file to run, add "/b /s /a:-d >names.txt" into a batch script and execute it.