CodShot
Batch Public

List Files by Extension

A Windows CMD command that lists files with a selected extension into a text file.

#cmd #windows #files #beginner
Batch
@echo off

dir /b *.png > png-files.txt

echo File list saved to png-files.txt
pause

Notes

Change *.png to another extension such as *.jpg or *.pdf.

Snippet actions

CodShot user
CodShot user
Updated: 2026-06-03 14:05
Public snippets
0
Forks
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support