You can get a plain-text list of files in a Windows folder using Command Prompt or PowerShell. Use it to check your installed mods, keep a file inventory, or send a list to someone helping you troubleshoot.
Replace C:\path\to\your\folder in the examples with your folder’s actual path. Keep the quotation marks, especially if the path contains spaces. These commands list files; they do not open or change them.
Option 1: Command Prompt
Press Windows + R, type cmd, and press Enter. Then run:
dir /b /a:-d "C:\path\to\your\folder"
This prints file names without the usual dates and sizes. It excludes folders and includes hidden and system files. It only lists the folder you specified. To include its subfolders and show full paths, add /s:
dir /b /s /a:-d "C:\path\to\your\folder"
If you prefer to change folders first, use cd /d "C:\path\to\your\folder", then run dir /b /a:-d. The /d lets Command Prompt change drives as well as folders.
Option 2: PowerShell
Press Windows + R, type powershell, and press Enter. For file names only, run:
Get-ChildItem -LiteralPath "C:\path\to\your\folder" -File | Select-Object -ExpandProperty Name
-LiteralPath treats characters such as square brackets as part of the path. -File excludes folders. PowerShell leaves out hidden and system files by default; add -Force if you want them included.
To include subfolders and show each file’s full path, use:
Get-ChildItem -LiteralPath "C:\path\to\your\folder" -File -Recurse | Select-Object -ExpandProperty FullName
Adding -Force includes hidden files, but does not grant access to folders your account cannot read.
Save the list to a text file
PowerShell can save a UTF-8 list to your Desktop. Save it outside the folder you are listing so the output file is not included in its own inventory:
$output = Join-Path ([Environment]::GetFolderPath('Desktop')) 'filelist.txt'
Get-ChildItem -LiteralPath "C:\path\to\your\folder" -File | Select-Object -ExpandProperty Name | Out-File -LiteralPath $output -Encoding utf8 -NoClobber
-NoClobber prevents overwriting an existing filelist.txt. If that name is already taken, change it to something like filelist-2.txt. Open the saved file in Notepad to copy or share the list.
File names and full paths can contain personal information, including your Windows username. Read through the list before sharing it.
Command references
Microsoft documents the options used here: dir, cd, Get-ChildItem, and Out-File.
Bonus: If you want a recursive search, which includes subdirectories, then add the -Recurse command like this:
Get-ChildItem -LiteralPath "C:\path\to\your\folder" -File -Recurse |
Select-Object -ExpandProperty FullName |
Out-File -LiteralPath $output -Encoding utf8 -NoClobber
Leave a Reply