R
Ryan Rupert
I have a command line utility for NTFS permissions editing
(http://setacl.sourceforge.net) that requires an absolute path to do
its magic. If curious why I need to use this it is because it is the
only way I have found to ONLY perform the Windows 2000 ACL "reset
permissions on all child objects and enable propagation of inheritable
permissions". I want to recurse a folder tree and ONLY apply
permissions changes on folders of the same name. So, I come up with
this:
FOR /R /D %%A IN ("folder name") DO setacl.exe -on "%%A" <setacl
options>
My problem is that when the FOR statement provides the value at %%A it
is something like this:
C:\folderA\folderB\folder name\"folder name"
How can I configure the FOR statement to only provide the full path to
matching directories? Also, the FOR result for matching directories
must NOT end with a forward slash. So, this is the result I want from
this FOR operation:
C:\folderA\folderB\folder name
(http://setacl.sourceforge.net) that requires an absolute path to do
its magic. If curious why I need to use this it is because it is the
only way I have found to ONLY perform the Windows 2000 ACL "reset
permissions on all child objects and enable propagation of inheritable
permissions". I want to recurse a folder tree and ONLY apply
permissions changes on folders of the same name. So, I come up with
this:
FOR /R /D %%A IN ("folder name") DO setacl.exe -on "%%A" <setacl
options>
My problem is that when the FOR statement provides the value at %%A it
is something like this:
C:\folderA\folderB\folder name\"folder name"
How can I configure the FOR statement to only provide the full path to
matching directories? Also, the FOR result for matching directories
must NOT end with a forward slash. So, this is the result I want from
this FOR operation:
C:\folderA\folderB\folder name