Is there a size limit for batch output files?

I wrote a very simple batch file that directs the output to a file. Here's the text body:

DATE /T > FileTreeList.txt TIME /T >> FileTreeList.txt cd >> FileTreeList.txt tree /f /a >> FileTreeList.txt 

When I run a batch file in a directory with many folders and files, the output file (FileTreeList.txt) is truncated to ~ 621 KB. If I run a batch file from command mode and direct output to a file, I get the same results. However, if I show the results on the screen, it will display all the results.

Why is this happening and how to fix it?

+5
source share
2 answers

Your hard drive is probably full and has only ~ 621 KB free space;)

+1
source

I think this is the current folder tree. If you want a larger file to try switching to% HOMEDRIVE% and list all the folders / files on the disk. Try this code:

 @rem Turn the command line (C:>COMMAND before every command) @echo off rem Go to the homedrive (if not currently in) if "%cd:~0,1%"=="%homedrive:~0,1%" call %homedrive:~0,1%: rem go to the root of homedrive cd %HOMEDRIVE% rem execute your code DATE /T > FileTreeList.txt TIME /T >> FileTreeList.txt cd >> FileTreeList.txt tree /f /a >> FileTreeList.txt 
0
source

All Articles