gpt-4o-mini-2024-07-18· OpenAI
WildChat-4.8M (AI2)
make bat script to read all filename in folder to txt
- User
make bat script to read all filename in folder to txt
- Assistant
You can create a batch script to list all the filenames in a specified folder and output them to a text file. Here’s a simple example of how to do this:
- Open a text editor (like Notepad).
- Copy and paste the following script:
batch@echo off setlocal :: Specify the folder you want to read set "folder=C:\path\to\your\folder" :: Specify the output file set "output=C:\path\to\your\output\filenames.txt" :: Check if output file already exists and delete it if exist "%output%" del "%output%" :: List filenames and output to the text file dir /b "%folder%" > "%output%" echo List of filenames has been saved to: %output% endlocal