Mitch Buz Stringer
Mitch Buz Stringer

Reputation: 399

Recursive directory listing - possible limitation issue

I run this script every night:

dir /s x:\>"X:\Back-Ups\File Lists\X-Drive-Complete-File-List.txt"

However the server has grown a lot since I first put it in place and I have hit a limitation. The file output stops at line 1002991, which is about half way.

I can't set it up for individual folders as the folders change frequently.

Is there anyway around this?

Upvotes: 0

Views: 75

Answers (2)

Compo
Compo

Reputation: 38708

As a potential alternative, it may be worth seeing how RoboCopy does.

RoboCopy X:\ Null /S /ZB /COPY:D /XJ /R:0 /W:0 /L /FP /NS /NC /NDL /NP /LOG:"%~dp0X-Drive-Complete-File-List.txt" /NJH /NJS

It should be run As administrator

Upvotes: 0

user7818749
user7818749

Reputation:

"I can't set it up for individual folders as the folders change frequently."

Yes you can:

for /d %%a in (X:\*) do (
    dir /s /b /a "%%a" > "X:\Back-Ups\File Lists\X-Drive-Complete-File-List.txt"
)

The parenthesis are not needed here, I purely used them to split the text into readable form. it can be just:

for /d %%a in (X:\*) do dir /s /b /a "%%a" > "X:\Back-Ups\File Lists\X-Drive-Complete-File-List.txt"

Upvotes: 0

Related Questions