CACLS Problem

G

Guest

I see that someone else posted a CACLS problem to this NG today, so what the
heck; seems like a good enough place......

According to the listed switches, /T "Changes ACLs of specified files in
the current directory and all subdirectories."
Yet if I switch to a particular directory then use the command, only the
subfolder's and file's permissions are changed. How do I get the current
directory to change?

Here is the syntax that I'm using (from the desired directory, of course):
cacls *.* /t /g <username>:<perms>

I've also tried typing the full path to the top directory in the tree, but
that doesn't work either.

Thanks.
 
P

Pegasus \(MVP\)

Charlie said:
I see that someone else posted a CACLS problem to this NG today, so what the
heck; seems like a good enough place......

According to the listed switches, /T "Changes ACLs of specified files in
the current directory and all subdirectories."
Yet if I switch to a particular directory then use the command, only the
subfolder's and file's permissions are changed. How do I get the current
directory to change?

Here is the syntax that I'm using (from the desired directory, of course):
cacls *.* /t /g <username>:<perms>

I've also tried typing the full path to the top directory in the tree, but
that doesn't work either.

Thanks.

.. . . and you're getting a response from the same person.

Your observation is at variance with mine. I used this command:

cacls *.txt /t /g everyone:F

and found that the permissions for all .txt files were changed,
regardless of whether they were located in the current folder
or any subfolder. I recommend you have another look.

Of course if you wish to change the permissions of the
current folder itself (rather than of the files inside it) then
you must do it from its parent. To change the permissions
for C:\Temp you would do this:

cacls c:\temp /t /e /g everyone:f

I also suggest you use the /e switch. Omitting it might
have undesireable results.
 
G

Guest

The second half of your answer applies.
I should have made it more clear that the files in the current directory got
changed as well as subfolders.
I wanted to be able to change permissions of the current folder
specifically, but I guess that can't be done. I can just rewrite the batch
file with that in mind.

Thanks.
 
P

Pegasus \(MVP\)

Of course you can change the permissions of your current folder:

cacls "%cd%" /e /t /g everyone:F
 
G

Guest

Yes, that works.
I for the life of me don't understand the switch, but I'll take it.

Thanks much.
 
P

Pegasus \(MVP\)

Windows 2000/XP writes the value of the current folder into
the environmental variable %cd%. Therefore, if you're currently
in "c:\documents and settings", %cd% is set to "c:\documents and settings".
This is precisely the entity whose access permissions you wish to change!
(including subfolders).
 
G

Guest

OK. Thanks for the explanation.

Pegasus (MVP) said:
Windows 2000/XP writes the value of the current folder into
the environmental variable %cd%. Therefore, if you're currently
in "c:\documents and settings", %cd% is set to "c:\documents and settings".
This is precisely the entity whose access permissions you wish to change!
(including subfolders).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top