日期:2014-05-17  浏览次数:20731 次

XCacls设置文件夹权限问题
现在垃圾软件越来越多,比如万象的广告,易游的广告就不举例了,服务器的广告文件夹用盘符来解决了,可客户端的不敢用这方法,原因在于插上U盘或手机盘符会指定到这文件夹上,我的电脑里没有盘符了。
比如想"C:\Program Files\Baidu"这个文件夹的权限设置成禁止任何用户写入/或访问,用Xcacls命令怎么写呢?因为英语太差看不懂帮助文件,下面把帮助文件贴上来:麻烦给个事例谢谢。
Assembly code

Used:
        Filename is required and was not passed as an argument.

---------------------------- Usage -------------------------------

Displays or modifies access control lists (ACLs) of files & directories

XCACLS filename [/E] [/G user:perm;spec] [...] [/R user [...]]
                [/F] [/S] [/T]
                [/P user:perm;spec [...]] [/D user:perm;spec] [...]
                [/O user] [/I ENABLE/COPY/REMOVE] [/N
                [/L filename] [/Q] [/DEBUG]

   filename            [Required] If used alone, it Displays ACLs.
                       (Filename can be a filename, directory name or
                       wildcard characters and can include the entire
                       path. If path is missing, its assumed to be
                       under the current directory.
                       Notes:
                       - Put filename in quotes if it has spaces or
                       special characters such as &, $, #, etc.
                       - If Filename is a directory, all files and
                       sub directories under it will NOT be changed
                       unless the /F or /S is present.

   /F                  [Used with Directory or Wildcard] This will change all
                       files under the inputed directory but will NOT
                       traverse sub directories unless /T is also present.
                       If filename is a directory, and /F is not used, no
                       files will be touched.

   /S                  [Used with Directory or Wildcard] This will change all
                       sub folders under the inputed directory but will NOT
                       traverse sub directories unless /T is also present.
                       If filename is a directory, and /S is not used, no
                       sub directories will be touched.

   /T                  [Used only with a Directory] Traverses each
                       subdirectory and makes the same changes.
                       This switch will traverse directories only if the
                       filename is a directory or is using wildcards.
   /E                  Edit ACL instead of replacing it.

   /G user:GUI         Grant security permissions similar to Windows GUI
                       standard (non-advanced) choices.
   /G user:Perm;Spec   Grant specified user access rights.
                       (/G adds to existing rights for user)

                       User: If User has spaces in it, surround it in Quotes
                             If User contains #machine#, it will replace
                             #machine# with the actual machine name if its a
                             non-domain controller, and replace it with the
                             actual domain name if it is a domain controller.

                             New to 3.0: User can be a string representing
                             the actual SID, but MUST be lead by SID#
                             Example: SID#S-1-5-21-2127521184-160...
                                      (SID string shown has been shortened)
                                      (If any user has SID# then globaly all
                                       matches must match the SID (not name)
                                       so if your intention is to apply changes
                                       to all accounts that match Domain\User
                                       then do not specify SID# as one of the
                                       users)

                       GUI: Is for standard rights and can be: