scripting the job of CACLS 
Author Message
 scripting the job of CACLS

Hi I am new to scripting and these news groups.

May main problem at the mo is trying to edit ACL's
on a heap of folders/subfolders. CACLS has crapped out
on me so i've turned to scripting as a possible solution.
Is this possible, any help appreciated.

Rob.



Mon, 27 Sep 2004 12:46:36 GMT  
 scripting the job of CACLS
Welcome, Robert.  A couple of notes and a question for you...

(1) One thing you will find out is that we often are quite happy to use CACLS
and XCACLS from WSH to solve things - for certain issues such as file/folder
iteration, the other alternatives can be really messy.  In fact, in my opinion
the only significant issue with XCACLS is the difficulty in figuring out how to
apply it correctly - the code is short and quick. So we may be suggesting you
look at CACLS again, depending on the issue.

(2) On posting, BTW, it's usually considered a "no-no" to multipost - make the
same post to 2 or more newsgroups by posting it twice. It makes it harder for
everyone to follow the answers to the problem - just an FYI.  In this case,
since people who hit the VBScript group usually check wsh also and vice-versa,
it doesn't even increase the exposure any.

Questions that it would help to know the answer to -

(a) What is your system running? NT4, Win2000, or what?

(b) What is the ACL permissions structure you want to put in place?  In other
words, what's the pattern for what people get what folder permissions and how
you want those to propagate?


Quote:
> Hi I am new to scripting and these news groups.

> May main problem at the mo is trying to edit ACL's
> on a heap of folders/subfolders. CACLS has crapped out
> on me so i've turned to scripting as a possible solution.
> Is this possible, any help appreciated.

> Rob.



Mon, 27 Sep 2004 13:05:32 GMT  
 scripting the job of CACLS
Yeah no worries, sorry about that.

    I'm running NT4.0 SP6A and i just want edit the permissions

    for a single individual on a single folder with heaps of sub folders.

    My cacls command was "D:\some_folder\some_folder>cacls *.* /c /t /e /g
joebloggs:C"

    It would get part way through processing the files and then stop with a
message saying 'The data is invalid.'

    I've tried various forms of the command to no avail.

 Cheers

Rob.



Quote:
> Welcome, Robert.  A couple of notes and a question for you...

> (1) One thing you will find out is that we often are quite happy to use
CACLS
> and XCACLS from WSH to solve things - for certain issues such as
file/folder
> iteration, the other alternatives can be really messy.  In fact, in my
opinion
> the only significant issue with XCACLS is the difficulty in figuring out
how to
> apply it correctly - the code is short and quick. So we may be suggesting
you
> look at CACLS again, depending on the issue.

> (2) On posting, BTW, it's usually considered a "no-no" to multipost - make
the
> same post to 2 or more newsgroups by posting it twice. It makes it harder
for
> everyone to follow the answers to the problem - just an FYI.  In this
case,
> since people who hit the vbscript group usually check wsh also and
vice-versa,
> it doesn't even increase the exposure any.

> Questions that it would help to know the answer to -

> (a) What is your system running? NT4, Win2000, or what?

> (b) What is the ACL permissions structure you want to put in place?  In
other
> words, what's the pattern for what people get what folder permissions and
how
> you want those to propagate?



> > Hi I am new to scripting and these news groups.

> > May main problem at the mo is trying to edit ACL's
> > on a heap of folders/subfolders. CACLS has crapped out
> > on me so i've turned to scripting as a possible solution.
> > Is this possible, any help appreciated.

> > Rob.



Mon, 27 Sep 2004 13:35:36 GMT  
 scripting the job of CACLS
That is a semi-generic API error which indicates that the information be
processed is bad - it unfortunately doesn't point to a specific thing, but it
suggests a couple of possibilities.  It is _not_ a normal CACLS error message.

It looked like you had a well formed command; what I am wondering is if there is
a problem with a file on the disk.  If the NTFS permissions for it become
mangled (due to a bad disk write or corruption within the file) I would expect a
message like that.

A couple of things I would be concerned about at once and then try as tests:

(1) Run chkdsk on that drive to see if anything is wrong.

(2) Try modifying permissions on a nested subfolder where the error occurs.

(3) A long shot problem, but one which I have seen before - see whether the
folder is in an extremely long nested sequence.  I've seen some which become
inaccessible when created programmatically on an NTFS partition on NT4 servers,
just due to the sheer number of characters in the path.

In any case, I don't think the issue is script-resolvable; would be good to hear
what actually happens when you check those things, though.


Quote:
> Yeah no worries, sorry about that.

>     I'm running NT4.0 SP6A and i just want edit the permissions

>     for a single individual on a single folder with heaps of sub folders.

>     My cacls command was "D:\some_folder\some_folder>cacls *.* /c /t /e /g
> joebloggs:C"

>     It would get part way through processing the files and then stop with a
> message saying 'The data is invalid.'

>     I've tried various forms of the command to no avail.

>  Cheers

> Rob.



> > Welcome, Robert.  A couple of notes and a question for you...

> > (1) One thing you will find out is that we often are quite happy to use
> CACLS
> > and XCACLS from WSH to solve things - for certain issues such as
> file/folder
> > iteration, the other alternatives can be really messy.  In fact, in my
> opinion
> > the only significant issue with XCACLS is the difficulty in figuring out
> how to
> > apply it correctly - the code is short and quick. So we may be suggesting
> you
> > look at CACLS again, depending on the issue.

> > (2) On posting, BTW, it's usually considered a "no-no" to multipost - make
> the
> > same post to 2 or more newsgroups by posting it twice. It makes it harder
> for
> > everyone to follow the answers to the problem - just an FYI.  In this
> case,
> > since people who hit the vbscript group usually check wsh also and
> vice-versa,
> > it doesn't even increase the exposure any.

> > Questions that it would help to know the answer to -

> > (a) What is your system running? NT4, Win2000, or what?

> > (b) What is the ACL permissions structure you want to put in place?  In
> other
> > words, what's the pattern for what people get what folder permissions and
> how
> > you want those to propagate?



> > > Hi I am new to scripting and these news groups.

> > > May main problem at the mo is trying to edit ACL's
> > > on a heap of folders/subfolders. CACLS has crapped out
> > > on me so i've turned to scripting as a possible solution.
> > > Is this possible, any help appreciated.

> > > Rob.



Mon, 27 Sep 2004 14:14:49 GMT  
 scripting the job of CACLS
I agree it might be a file system error. I would try and delete the ACE
manually. If you are not sure how just right click on the folder/file and
locate the permissions button. For the user that you want to change the
permissions for with CACLS highlight and delete the ACE (Access Control
Entry). Ok all of that then add the ACE again manually. Try that if not
delete copy the file/folder to a FAT drive or another volume so that the ACL
is removed then copy it back.

A bit long winded but if there is a filesystem error I assume that you dont
want to delete your data.

HTH

-----
Matt



Quote:
> That is a semi-generic API error which indicates that the information be
> processed is bad - it unfortunately doesn't point to a specific thing, but
it
> suggests a couple of possibilities.  It is _not_ a normal CACLS error
message.

> It looked like you had a well formed command; what I am wondering is if
there is
> a problem with a file on the disk.  If the NTFS permissions for it become
> mangled (due to a bad disk write or corruption within the file) I would
expect a
> message like that.

> A couple of things I would be concerned about at once and then try as
tests:

> (1) Run chkdsk on that drive to see if anything is wrong.

> (2) Try modifying permissions on a nested subfolder where the error
occurs.

> (3) A long shot problem, but one which I have seen before - see whether
the
> folder is in an extremely long nested sequence.  I've seen some which
become
> inaccessible when created programmatically on an NTFS partition on NT4
servers,
> just due to the sheer number of characters in the path.

> In any case, I don't think the issue is script-resolvable; would be good
to hear
> what actually happens when you check those things, though.



> > Yeah no worries, sorry about that.

> >     I'm running NT4.0 SP6A and i just want edit the permissions

> >     for a single individual on a single folder with heaps of sub
folders.

> >     My cacls command was "D:\some_folder\some_folder>cacls *.* /c /t /e
/g
> > joebloggs:C"

> >     It would get part way through processing the files and then stop
with a
> > message saying 'The data is invalid.'

> >     I've tried various forms of the command to no avail.

> >  Cheers

> > Rob.


wrote

> > > Welcome, Robert.  A couple of notes and a question for you...

> > > (1) One thing you will find out is that we often are quite happy to
use
> > CACLS
> > > and XCACLS from WSH to solve things - for certain issues such as
> > file/folder
> > > iteration, the other alternatives can be really messy.  In fact, in my
> > opinion
> > > the only significant issue with XCACLS is the difficulty in figuring
out
> > how to
> > > apply it correctly - the code is short and quick. So we may be
suggesting
> > you
> > > look at CACLS again, depending on the issue.

> > > (2) On posting, BTW, it's usually considered a "no-no" to multipost -
make
> > the
> > > same post to 2 or more newsgroups by posting it twice. It makes it
harder
> > for
> > > everyone to follow the answers to the problem - just an FYI.  In this
> > case,
> > > since people who hit the vbscript group usually check wsh also and
> > vice-versa,
> > > it doesn't even increase the exposure any.

> > > Questions that it would help to know the answer to -

> > > (a) What is your system running? NT4, Win2000, or what?

> > > (b) What is the ACL permissions structure you want to put in place?
In
> > other
> > > words, what's the pattern for what people get what folder permissions
and
> > how
> > > you want those to propagate?



> > > > Hi I am new to scripting and these news groups.

> > > > May main problem at the mo is trying to edit ACL's
> > > > on a heap of folders/subfolders. CACLS has crapped out
> > > > on me so i've turned to scripting as a possible solution.
> > > > Is this possible, any help appreciated.

> > > > Rob.



Mon, 27 Sep 2004 20:14:04 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. AD: Startup script/Cacls

2. can i script CACLS?

3. problem running cacls from script

4. Setting permissions with cacls in a script

5. Job posting to ba.jobs.offered

6. ** JOB ** - JOB Opportunities in NYC area

7. Trying to DUPLEX PCL job at the back of a poscript job

8. Calling //job from //job in .wsf

9. Script for monitor NetBackup jobs

10. CACLS & ASP = Fail

11. looking for a person with excellent scripting - will pay on a per job basis

12. Error running CACLS with Run method

 

 
Powered by phpBB® Forum Software