AW: Change File/Directory permissions

"Lüth, Carsten" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
Hi Stefan!

Use Xcacls.exe to modify NTFS permissions!

http://support.microsoft.com/kb/318754/EN-US/


Xcacls.exe syntax
xcacls file name [/T] [/E] [/C] [/G user:perm;spec] [/R user] [/P
user:perm;spec [...]] [/D user [...]] [/Y] 
where file name indicates the name of the file or folder to which the ACL or
access control entry (ACE) is typically applied. All standard wildcard
characters can be used. 

/T recursively walks through the current folder and all of its subfolders,
applying the chosen access rights to the matching files or folders. 

/E edits the ACL instead of replacing it. For example, only the
administrator will have access to the Test.dat file if you run the XCACLS
test.dat /G Administrator:F command. All ACEs applied earlier are lost. 

/C causes Xcacls.exe to continue if an "access denied" error message occurs.
If /C is not specified, Xcacls.exe stops on this error. 

/G user:perm;spec grants a user access to the matching file or folder. * The
perm (permission) variable applies the specified access right to files and
represents the special file-access-right mask for folders. The perm variable
accepts the following values:* R Read  
* C Change (write)  
* F Full Control  
* P Change Permissions (special access)  
* O Take Ownership (special access)  
* X EXecute (special access)  
* E REad (Special access)  
* W Write (Special access)  
* D Delete (Special access)  
 
* The spec (special access) variable applies only to folders and accepts the
same values as perm, with the addition of the following special value:* T
Not Specified. Sets an ACE for the directory itself without specifying an
ACE that is applied to new files created in that directory. At least one
access right has to follow. Entries between a semicolon (;) and T are
ignored. Notes* The access options for files (for folders, special file and
folder access) are identical. For detailed explanations of these options,
see the Windows 2000 operating system documentation.  
* All other options, which can also be set in Windows Explorer, are subsets
of all possible combinations of the basic access rights. Because of this,
there are no special options for folder access rights, such as LIST or READ.

 
 
/R user revokes all access rights for the specified user. 

/P user:perm;spec replaces access rights for user. The rules for specifying
perm and spec are the same as for the /G option. See the "Xcacls.exe
examples" section of this article. 

/D user denies user access to the file or directory. 

/Y disables confirmation when replacing user access rights. By default,
CACLS asks for confirmation. Because of this feature, when CACLS is used in
a batch routine, the routine stops responding until the right answer is
entered. The /Y option was introduced to avoid this confirmation, so that
Xcacls.exe can be used in batch mode. 


Mit freundlichem Gruß / With kind regards 

Fielmann AG 

Carsten Lüth 
IT - Desktop Services
Weidestraße 118a 
22083 Hamburg 
Telefon: +49 - (0) 40 - 2 70 76 - 199 
mailto:[email protected] 



-----Ursprüngliche Nachricht-----
Von: Stefan Lubitz [mailto:[email protected]] 
Gesendet: Dienstag, 17. Oktober 2006 01:03
An: [email protected]
Betreff: [AutoIt] Change File/Directory permissions


Hi all,

I searched for a way to change file/directory permissions with AutoIt, 
but have not found something.
Is there a way to handle this?

Regards,
Stefan



 
Yahoo! Groups Links





 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AutoItList/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/AutoItList/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[email protected] 
    mailto:[email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.