Solved icacl wildcard?

I am trying to edit the permissions of folders that are in folders that are named differently. I am doing cacls commads and icacl commands

The following works:
Code:
cacls c:\test\\Secure /T /E /G "Domain Admins":F

This doesn't work:
Code:
icacls c:\test\\Secure /grant "__Project Managers":(OI)(CI)(WO)

The problem is that I can't use "\\" to apply the script to all directories in C:\test.
Is there a way to put a wildcard inbetween the "\\"?

I have tried everything that I know of and have been looking through forums for hours and hours. Any help is appreciated. THANKS!!
 
Last edited:

My Computer

Hi Franklin,

Have you tried using SWXCACLS?

SWXCACLS

It might have what you need.

If not, we could do this with a batch file. Could you run the following command in your C:\test folder please:

dir /b /s > dir.txt && start notepad.exe dir.txt

Then copy and paste the contents of this into your next post please :)

Tom
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics Card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD
    Seagate Barracuda 2TB 7200rpm
    2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
Hello Franklin,

Have you resolved this issue? The thread is marked as solved, but we haven't heard from you :(

Tom
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics Card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD
    Seagate Barracuda 2TB 7200rpm
    2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
I solved my first issue with what I replied in my second post.

I needed /T in the second command

I do have a new issue though. The wildcard that I was using in that command (typing nothing between the "\\")was working fine with Windows 7, but now that I moved it to the server, which is running Windows Server 2008, it stopped working. I can type the name of the folder in that space and it works perfectly. I have tried everything and I have narrowed it down to the wildcard.

Does anyone know the wildcard for a folder in Windows Server 2008?
Thanks!
 

My Computer

Here is my entire code:

Code:
cacls d:\Project01\\Correspondence\Emails\Secure /T /G "Domain Admins":F
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)R /T
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)RX /T
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)W /T
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)M /T
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)(DC) /T
icacls d:\Project01\\Correspondence\Emails\Secure /grant "Project Managers":(OI)(CI)(WO) /T
cacls d:\Project01\\Correspondence\Emails\Secure /T /E /R everyone

I did edit it some to keep some info about the business off of the forum, but it should be the same thing.

The 1st command grants the group "Domain Admins" Full Control.
The 2nd - 6th commands grants the group "Project Managers" various permissions.
The 7th command revokes the permissions for "Everyone."
 

My Computer

I decided to try it with PowerShell again. It was very easy.
Code:
$acl = Get-Acl H:\test\Correspondence\Emails\Secure
$acl = Set-Acl C:\projects\*\Correspondence\Emails\Secure
$acl = Set-Acl C:\projects\*\Correspondence\Emails\Secure\*.*
It copies the permissions of the folder to the other folder and then to all files in the second folder.
I hope this helps someone else.
 
Last edited:

My Computer

Hi Franklin,

It's good to hear you've managed to sort your problem out :) Thanks for sharing the solution! Sorry I couldn't be of much use, I don't have any experience with Windows Server 2008 whatsoever.

Tom
 

My Computer

System One

  • Manufacturer/Model
    Build #1
    CPU
    Intel Core i7 3770K @4.4GHz
    Motherboard
    ASUS P8Z77-V PRO
    Memory
    Corsair Vengeance 2x4GB DDR3 1600MHz Low Profile (White)
    Graphics Card(s)
    Gigabyte Radeon HD 7850 (2GB GDDR5)
    Sound Card
    Integrated on motherboard
    Monitor(s) Displays
    23" LG LCD/LED IPS
    Screen Resolution
    1920*1080
    Hard Drives
    Samsung EVO 128GB SSD
    Seagate Barracuda 2TB 7200rpm
    2x500GB Seagate FreeAgent 5400rpm
    PSU
    Corsair TX650W V2 (80+ Bronze)
    Case
    NZXT Phantom 410
    Cooling
    Corsair H100 Water Cooler, 1x140mm and 1x120mm stock fans
    Keyboard
    Microsoft Desktop 2000 Wireless Keyboard
    Mouse
    Microsoft Desktop 2000 Wireless Mouse
    Internet Speed
    95 Mb/s Download 70 Mb/s Upload
Back
Top