Take the 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.
{"cc_re__cc_re__cc_by_sa_3_0": ["        <li><a href=\"http://area51.stackexchange.com\" title=\"proposing new sites in the Stack Exchange network\">Area 51</a></li>\r\n                        <li><a href=\"http://careers.stackoverflow.com\">Stack Overflow Careers</a></li>\r\n                    \r\n                </ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2013 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc-wiki</a> \r\n with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"footer-flair\">\r\n                <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" class=\"cc-wiki-link\"></a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2013.12.10.1212\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault", "ol>\r\n            </td>\r\n    </tr>\r\n</table>\r\n                </div>\r\n            </div>\r\n\r\n            <div id=\"copyright\">\r\n                site design / logo &#169; 2013 stack exchange inc; user contributions licensed under <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" rel=\"license\">cc-wiki</a> \r\n with <a href=\"http://blog.stackoverflow.com/2009/06/attribution-required/\" rel=\"license\">attribution required</a>\r\n            </div>\r\n            <div id=\"footer-flair\">\r\n                <a href=\"http://creativecommons.org/licenses/by-sa/3.0/\" class=\"cc-wiki-link\"></a>\r\n            </div>\r\n            <div id=\"svnrev\">\r\n                rev 2013.12.10.1212\r\n            </div>\r\n            \r\n        </div>\r\n    </div>\r\n    <noscript>\r\n        <div id=\"noscript-warning\">Server Fault works best with JavaScript enabled<img src=\"http://pixel.quantserve.com/pixel/p-c1rF4kxgLUzNc.gif\" alt=\"\" class=\"dno\"></div>\r\n    </noscript>\r\n<script type=\"text/javascript\">var p = \"http\", d = \"static\"; if (document.location.protocol == \"https:\") { p += \"s\"; d = \"engine\"; } var "], "copyright__copyright__copyright": ["nto the maxlength for a path.\n\n\"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.\"\n\nSource: http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx\n\nshare|improve this answer\nadd comment\n\nYour Answer\n\n\u00a0\ndiscard\n\nBy posting your answer, you agree to the privacy policy and terms of service.\n\nNot the answer you're looking for? Browse other questions tagged or ask your own question."]}