Re: Folder depth & cacls




..... Oops ....

Forgot the POPD

@echo off
setlocal
set work=C:\Folder
pushd "%work%"
@echo Y| CALCS "%work%" /E /C /G ....
for /f "Tokens=*" %%a in ('dir /b /a /s') do (
call :sub "%%a"
POPD
)
endlocal
goto :EOF
:sub
set fold=%~DP1
if /i "%fold%" EQU "%work%" goto sub1
pushd "%fold%"
set work=%fold%
@echo Y| CALCS "%work%" /E /C /G ....
:sub1
set file=%~nx1
@echo Y| CALCS "%file%" /E /C /G ....


On Fri, 15 Jul 2005 02:15:02 -0700, JAR <JAR@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>I am trying to edit the permissions of two folder trees (on 2 servers) using
>either cacls or xcacls (want to add permissions for a specific group so don't
>want to use the GUI) and am hitting a problem related to the folder depth
>and/or path length. The process runs so far but then fails and I'm pretty
>sure it's related to the depth of some folders.
>
>Getting either "The data area passed to a system call is too small" or "The
>filename, directory name, or volume label syntax is incorrect." dpending on
>which server I run it on.
>
>If I knew that it was only affecting a couple of folders I would just go
>down one level and run the command there but I know this is NOT the case as
>there are a LOT of folders to run through.
>
>Does anyone have any ideas for a workaround for this - maybe using a script
>or something ?
>
>Thanks
>
>

See if something like this works:

@echo off
setlocal
set work=C:\Folder
pushd "%work%"
@echo Y| CALCS "%work%" /E /C /G ....
for /f "Tokens=*" %%a in ('dir /b /a /s') do (
call :sub "%%a"
)
endlocal
goto :EOF
:sub
set fold=%~DP1
if /i "%fold%" EQU "%work%" goto sub1
pushd "%fold%"
set work=%fold%
@echo Y| CALCS "%work%" /E /C /G ....
:sub1
set file=%~nx1
@echo Y| CALCS "%file%" /E /C /G ....
..
.



Relevant Pages

  • Re: Folder depth & cacls
    ... >I am trying to edit the permissions of two folder trees (on 2 servers) using ... >either cacls or xcacls (want to add permissions for a specific group so don't ... >sure it's related to the depth of some folders. ... call:sub "%%a" ...
    (microsoft.public.windows.file_system)
  • Re: Move applied to MailItem alters ReceivedTime
    ... Seems to work both as sub or function, but the result is ... > Are you moving messages between two folders from *different* PST stores? ... It appears that after applying the move method the ReceivedTime ... >> Dim found As Boolean ...
    (microsoft.public.outlook.program_vba)
  • Re: I need to create a Folder Wrapper Class... HELP!!!
    ... Friend Sub InitHandlerExpl(olapp As Outlook.Application, ... Set objOutlook = olapp 'Declared WithEvents ... I can then use the colExpl_NewExplorer event to add a new explorer to ... So because I need to handle all accessed folders (not just certain ...
    (microsoft.public.outlook.program_addins)
  • Re: Relative File Path Name
    ... provide me with some sample code that uses them. ... Sub SaveInstructions(ProjNum, DocName) ' called by Private Sub cmdOK_Click ... and related destination folders are stored, ...
    (microsoft.public.word.vba.general)
  • Re: Delete/Move Attachments
    ... here is a sample for a recursive iteration through the folders: ... Loop through the Outlook folders hierarchy for handling _ ... Public Sub HandleAllItems ... ' Loop through all folders. ...
    (microsoft.public.outlook.program_vba)