|Got a batch file which will check the file size of a file\folder and print it in a seperate txt|
Eg: Here's a line from my batch
FOR /F "usebackq" %%A IN ('%filename1%') DO set filesize1=%%~zA
echo %filename1% %filesize1% >>u.txt
Contents of U.txt
The numbers on the right represent the size in bytes of every file. The "work" folder is empty, thus it shows 0.
The issue is sometimes depending on what drive the batch checks, what drive I run it from, etc, an empty folder will end up showing without the 0 on its right such as:
contents of u.txt:
There may be a hundred reasons why that may happen but I just need to know How to automatically put a 0 in front of every empty folder in my txt file because without a number in the front of the folder , the batch will crash as the number needs to be set as a variable later on.