Re: Command Line / Batch File set permissions for folders / files
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 09/11/04
- Next message: Torgeir Bakken \(MVP\): "Re: Windows XP SP2 Firewall"
- Previous message: Torgeir Bakken \(MVP\): "Re: ?? How can I turn my Virus Protect back on??"
- In reply to: Alex: "Command Line / Batch File set permissions for folders / files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 11 Sep 2004 01:24:26 +0200
Alex wrote:
> How Do I set/change permissions on Folders or Files using
> the Command Line (or in a batch file)?
>
> (I am creating a batch file to automate some stuff and
> after creating a directory, I need to uncheck the inherit
> from parent, add one user with Modify rights and remove
> Everyone)
Hi
Some options for you:
1)
I don't know but cacls.exe (comes builtin with WinXP), or xcacls.exe
(in WinXP Support Tools) might be able to do this.
HOW TO: Use Xcacls.exe to Modify NTFS Permissions
http://support.microsoft.com/default.aspx?scid=kb;en-us;318754
Windows XP Service Pack 2 Support Tools
http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38
Xcacls.exe have some issues:
Child objects in a folder do not inherit permissions as expected
when you use Xcacls.exe with the /E switch
http://support.microsoft.com/default.aspx?scid=KB;EN-US;822790
2)
I'm pretty sure xcacls.vbs is able to to it:
Download details: Extended Change Access Control List Tool (Xcacls)
http://www.microsoft.com/downloads/details.aspx?familyid=0ad33a24-0616-473c-b103-c35bc2820bda&displaylang=en
3)
FILEACL.exe should be able to do it:
FILEACL.exe - NTFS Permissions command line tool
http://www.microsoft.com/downloads/details.aspx?FamilyID=723f64ea-34f0-4e6d-9a72-004d35de4e64&DisplayLang=en
4)
I know that SetACL.exe can do it:
SetACL.exe (freeware)
http://setacl.sourceforge.net/
-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx
- Next message: Torgeir Bakken \(MVP\): "Re: Windows XP SP2 Firewall"
- Previous message: Torgeir Bakken \(MVP\): "Re: ?? How can I turn my Virus Protect back on??"
- In reply to: Alex: "Command Line / Batch File set permissions for folders / files"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|