Its not related to c# , but can anyone tell me how to use CALCS in a batch file ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tezu
    New Member
    • Dec 2008
    • 39

    Its not related to c# , but can anyone tell me how to use CALCS in a batch file ?

    Hi,

    I know this is not relevant to C# , but still im having some issues while using CALCS in my batch file. can anyone let me know how can we use CLACS in a batch file.
    any help is welcome :)

    Thanks in advance
  • Subin Ninan
    New Member
    • Sep 2010
    • 91

    #2
    USAGE:

    CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
    [/P user:perm [...]] [/D user [...]]

    Example:

    CACLS "c:\abc.txt " /D Everyone

    This will deny access to abc.txt for all user.

    CACLS "C:\abc.txt " /G Everyone:F

    This will grant access to abc.txt to all users.


    Open command prompt and type "CACLS /?" to view usage.

    Comment

    • tezu
      New Member
      • Dec 2008
      • 39

      #3
      Its not related to c# , but can anyone tell me how to use CALCS in a batch file ?

      Hey thx so much for teh reply it works:)

      however i'm facing some problem in giving full control permissions to all the files in a folder.How can we achive this recursively using any other command??? any idea???

      Thx :)

      Comment

      • Subin Ninan
        New Member
        • Sep 2010
        • 91

        #4
        To give full permission to all files in a directory:

        CACLS "c:\setups" /T /E /G everyone:F

        /T = change ACL to all files & subdirectories.
        /E = Edit ACL
        /G = Grant permission
        "everyone:F " = specify username : permission

        Valid permissions:
        F = Full control
        R = Read
        W = Write
        C = Change
        Last edited by Subin Ninan; Sep 27 '10, 04:16 AM. Reason: Formatting error

        Comment

        • tezu
          New Member
          • Dec 2008
          • 39

          #5
          To give full permission to all files in a directory

          Hi,
          Im using the same currently, but somehow when i do it using CACLS some permissions i think are not getting applied, for the same if i do manually is working ....

          s there any other command apart frm CACLS , which we can use instead?

          Thx :)

          Comment

          • Subin Ninan
            New Member
            • Sep 2010
            • 91

            #6
            Use Microsoft's SubInAcl

            Comment

            • tezu
              New Member
              • Dec 2008
              • 39

              #7
              Do we need to download anything for it ??? or can we use it directly??

              Do u hae any samples of how to use it ?

              Comment

              • tezu
                New Member
                • Dec 2008
                • 39

                #8
                Hi ,

                I think the command subinacl is used only to change the ownership of the directory , not for changing permissions ...

                Comment

                • tezu
                  New Member
                  • Dec 2008
                  • 39

                  #9
                  Hi subin Ninan,

                  Thanks for the help using CACLS worked perfectly, some problem was there with my syntax itself. Thanks a LOT :)

                  Comment

                  • Subin Ninan
                    New Member
                    • Sep 2010
                    • 91

                    #10
                    SubInAcl also allows to set permission.
                    You can also have a look on xCacls, FileAcl, setACL.

                    Comment

                    Working...