Advertisement
iTA360

TXT List of Current Folder Files with Size Bat Code

Jul 11th, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3.  
  4. set "output=_List.txt"
  5.  
  6. rem Loop through each file in the current directory
  7. for %%F in (*) do (
  8. set "file=%%F"
  9.  
  10. rem Get the size of the file
  11. for %%A in ("!file!") do set "size=%%~zA"
  12.  
  13. rem Append the file name and size to the output file
  14. echo !file! - !size! bytes>> "%output%"
  15. )
  16.  
  17. echo List generated and saved as "%output%"
  18.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement