1

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

1

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(VS.85).aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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