Changing permission recursively

Z

Zeepowlee

Hi all,

some days ago I asked about changing ownership and permission of files,
after moving an HD on a different client.
I was suggested to change the owner of the file(s) to administrator, then
re-open properties and edit permission for administrator.
It works fine (thanks folks) but I'd like to do this for many folders and
subfolders at once. It seems not working. It seems when different file types
are included, the multiple selection do not work for changing ownership.
To change permission for all files and folders on the HD it'd become
extremely time consuming.

Can anybody suggest a better way, if exists?


Thank you
 
J

Jerold Schulman

Hi all,

some days ago I asked about changing ownership and permission of files,
after moving an HD on a different client.
I was suggested to change the owner of the file(s) to administrator, then
re-open properties and edit permission for administrator.
It works fine (thanks folks) but I'd like to do this for many folders and
subfolders at once. It seems not working. It seems when different file types
are included, the multiple selection do not work for changing ownership.
To change permission for all files and folders on the HD it'd become
extremely time consuming.

Can anybody suggest a better way, if exists?


Thank you
See tip 3528 » How do I set ownership and manage permissions from the command line or in a batch?
and links in the 'Tips & Tricks' at http://www.jsifaq.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
http://www.jsifaq.com
 
P

Pegasus \(MVP\)

In your previous thread Jim Howes recommended that you
use subinacl.exe to seize ownership of a folder and all its
subfolders. The answer is still the same. If this does not
work for you then you should post
a) the command you use, and
b) the messages you get.

The same goes when you use the GUI, as suggested by
John John.
 
Z

Zeepowlee

See tip 3528 » How do I set ownership and manage permissions from the
command line or in a batch?
and links in the 'Tips & Tricks' at http://www.jsifaq.com

Jerold Schulman

Jerold,

I installed subinacl, but running the command
subinacl /subdirectories <FolderPath>\*.* /setowner=<DomainName\UserName>
it says:
'subinacl' is not recognized as an internal or external command

cacls is recognized instead.

thanks
 
D

Dave Patrick

If it's not installed in your path then use something like;

C:\FullPathToFile\subinacl ..............

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

:
| I installed subinacl, but running the command
| subinacl /subdirectories <FolderPath>\*.* /setowner=<DomainName\UserName>
| it says:
| 'subinacl' is not recognized as an internal or external command
|
| cacls is recognized instead.
|
| thanks
|
|
 
P

Pegasus \(MVP\)

Zeepowlee said:
Jerold,

I installed subinacl, but running the command
subinacl /subdirectories <FolderPath>\*.* /setowner=<DomainName\UserName>
it says:
'subinacl' is not recognized as an internal or external command

cacls is recognized instead.

thanks

Where exactly did you copy subinacl.exe to?
 
J

John John

Where did you put SubInACL.exe? If it's the Resource Kit folder make
sure that the folder is in the Environment PATH Variables or stick
SubInACL.exe in the System32 folder. Or run it from where it is.

John
 
Z

Zeepowlee

Ok now I am running it from the installation folder.
I get
Error 1337, the security ID structure is invalid.

In my Path I have long folder names, e.g.: Documents and settings,
while in the error message it appears just as "documents"
May it be the root of the error?

THX
 
P

Pegasus \(MVP\)

Let's have a look at the command you use.


Zeepowlee said:
Ok now I am running it from the installation folder.
I get
Error 1337, the security ID structure is invalid.

In my Path I have long folder names, e.g.: Documents and settings,
while in the error message it appears just as "documents"
May it be the root of the error?

THX
 
Z

Zeepowlee

subinacl /subdirectories e:\documents and settings\mysubdir1\mysubdir2\*.*
/setowner=PPP\Administrators

I get:

LookupAccountName : setowner e:\documents : PPP\administrators : 1337 The
security ID structure is invalid

Current object e:\documents will not be processed
 
P

Pegasus \(MVP\)

You must surround all long file/folder names with double quotes.
If you don't then the command will get very confused about
what is a file name and what is a switch.

subinacl /subdirectories "e:\documents and settings\mysubdir1\mysubdir2\*.*"
/setowner=PPP\Administrators
 
Z

Zeepowlee

I run the command (1 space after subdirectories and no spaces after *.*",
right?)
and I get

Elapsed Time: 00 00:00:00
Done: 0 Modified 0 Failed 0 Syntax errors 0


No file had changed ownership...
 
Z

Zeepowlee

By the way,
if I run

cacls "mypath..."

I get:
BUILTIN\Administrators<OI><CI>C
BUILTIN\Administrators<OI><CI>F
<Account Domain not found><OI><CI>F
NT AUTHORITY\SYSTEM:<OI><CI>F
 
P

Pegasus \(MVP\)

Once more I ask that you let us see the ***full*** command,
not just a fragment.
 
Z

Zeepowlee

The ***full*** command is:

subinacl/subdirectories "E:\Documents and
Settings\Mysubdir1\Mysubdir2\*.*"/setowner=PPP\Administrators


Done: 0, Modified: 0, Failed 0, Syntax Errors 0


Thanks for help
 
P

Pegasus \(MVP\)

The /subdirectories switch instructs subinacl.exe to deal
with FOLDER names. However, "Mysubdir2\*.*" denotes
FILE names! Perhaps you see now why I keep asking
for the full command you use, in spite of your reluctance
to post it.

subinacl subdirectories "E:\Documents and Settings\Mysubdir1\Mysubdir2"
/setowner=PPP\Administrators

Furthermore I consider it a bad habit to run parameters
together. I know that it works for most of the time but a
much safer way is to place at least one space between
parameters.
 
Z

Zeepowlee

The /subdirectories switch instructs subinacl.exe to deal
with FOLDER names. However, "Mysubdir2\*.*" denotes
FILE names! Perhaps you see now why I keep asking
for the full command you use, in spite of your reluctance
to post it.

No reluctance, I was just executing the command I found in the page
suggested by another poster.
subinacl subdirectories "E:\Documents and Settings\Mysubdir1\Mysubdir2"
/setowner=PPP\Administrators

I did, and it does not do absolutely anything.
Elapsed Time 00:00
Done 0, Failed 0 .... etc...

Furthermore I consider it a bad habit to run parameters
together. I know that it works for most of the time but a
much safer way is to place at least one space between
parameters.

Same as above. I copied the command from that page.


Thanks for help
 
P

Pegasus \(MVP\)

Zeepowlee said:
No reluctance, I was just executing the command I found in the page
suggested by another poster.


I did, and it does not do absolutely anything.
Elapsed Time 00:00
Done 0, Failed 0 .... etc...



Same as above. I copied the command from that page.

Thanks for help

Well, since the command worked for me its syntax is correct.
You must now look at your localised parameters:
- Is E: an NTFS partition?
- Does E:\Documents and Settings\Mysubdir1\Mysubdir2 exist?
- Is PPP\Administrators a valid account? (To me it looks like
a group, not an account).
 
Z

Zeepowlee

Well, since the command worked for me its syntax is correct.
You must now look at your localised parameters:
- Is E: an NTFS partition?
Yes.

- Does E:\Documents and Settings\Mysubdir1\Mysubdir2 exist?

Yes. And if it did not exist, I guess subinacl would give me an error
message?

- Is PPP\Administrators a valid account? (To me it looks like
a group, not an account).

You mean an account should be Zeepowlee\PPP\Administrators?
 

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