Windows Vista Forums

icacl wildcard?
  1. #1



    Newbie
    Join Date : Aug 2012
    Posts : 5
    Vista Ultimate x64
    Local Time: 07:13 PM

    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 by franklin86; 10 Aug 2012 at 12:27 PM. Reason: code showed as smiley face
      My System SpecsSystem Spec

  2. #2



    Newbie
    Join Date : Aug 2012
    Posts : 5
    Vista Ultimate x64
    Local Time: 07:13 PM


      Thread Starter

    Re: icacl wildcard?

    I needed /T in the second command

      My System SpecsSystem Spec

  3. #3
    tom982's Avatar

    ٩(͡๏̯͡๏)۶



    Join Date : Mar 2010
    England
    Posts : 3,642
    Windows 7 Ultimate x64 SP1
    Local Time: 12:13 AM
    uk uk england

     

    Re: icacl wildcard?

    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 System SpecsSystem Spec

  4. #4
    tom982's Avatar

    ٩(͡๏̯͡๏)۶



    Join Date : Mar 2010
    England
    Posts : 3,642
    Windows 7 Ultimate x64 SP1
    Local Time: 12:13 AM
    uk uk england

     

    Re: icacl wildcard?

    Hello Franklin,

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

    Tom

      My System SpecsSystem Spec

  5. #5



    Newbie
    Join Date : Aug 2012
    Posts : 5
    Vista Ultimate x64
    Local Time: 07:13 PM


      Thread Starter

    Re: icacl wildcard?

    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 System SpecsSystem Spec

  6. #6



    Newbie
    Join Date : Aug 2012
    Posts : 5
    Vista Ultimate x64
    Local Time: 07:13 PM


      Thread Starter

    Re: icacl wildcard?

    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 System SpecsSystem Spec

  7. #7



    Newbie
    Join Date : Aug 2012
    Posts : 5
    Vista Ultimate x64
    Local Time: 07:13 PM


      Thread Starter

    Re: icacl wildcard?

    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 by franklin86; 20 Aug 2012 at 03:45 PM.
      My System SpecsSystem Spec

  8. #8
    tom982's Avatar

    ٩(͡๏̯͡๏)۶



    Join Date : Mar 2010
    England
    Posts : 3,642
    Windows 7 Ultimate x64 SP1
    Local Time: 12:13 AM
    uk uk england

     

    Re: icacl wildcard?

    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 System SpecsSystem Spec

icacl wildcard? problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change filename using a wildcard touch0ph VB Script 4 20 Apr 2009
Run Exe From a CD with wildcard Oli M VB Script 17 16 Apr 2009
how to get the file name from using a wildcard Daz VB Script 8 02 Jun 2008
WildCard SSL Certificates Jeff Parrish Vista mail 0 14 Sep 2006
Wildcard searches =?Utf-8?B?ZnJhY3RhbHN1YXI=?= Vista file management 5 23 Aug 2006