Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.



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?

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

Process.bat
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
add comment

1 Answer

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."

Source: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx

share|improve this answer
add comment

Your Answer

 
discard

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.