Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have created two batch files which set two lots of folder permissions. T:\folder1 level1 all get read only permissions. T:\folder1\subfolder1 level2 all get change permissions. The batch files we have created work fine and get through to H in the folder list at level1 and then simply bomb out without any explanation. Is there a buffer that is getting filled or something we need to extend to make this work? Client machines running the command are Vista 64bit 12GB RAM. At level1 there are approx 3,000 folders. Total amount of data that the command runs against about 600GB. File quits out after processing around 20,000 files. Any ideas?

echo on
for /d %%a IN (.\*.*) do call Q:\Admin\client\temp\process.bat %%a

echo y|cacls %1 /C /T /G "mydomain\domain users":r "builtin\administrators":f "mydomain2\domain users":r "mydomain\domain admins":f "mydomain\administrator":f "mydomain\user1":f "mydomain\user2":f

for /d %%b IN (%1\*.*) do echo y|cacls "%%b" /C /T /G "mydomain\domain users":c "builtin\administrators":f "mydomain2\domain users":c "mydomain\domain admins":f "mydomain\administrator":f "mydomain\user1":f "mydomain\user2":f

cd ..

share|improve this question
up vote 1 down vote accepted

You're probably running into the maxlength for a path.

"In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters."


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.