如何在Command prompt下給予權限?





tomjen
2004-06-17, 01:15 AM
Dear All,
小弟最近突然對一些Command prompt的指令感到好奇...:)
還有些疑問想請教前輩:
不知道在command下可以給予某帳號對於某資料夾的NTFS權限嗎?
ex.給mary 在c:\mary有完全控制的權限.

小弟知道Xcacls好像可以,但想知道是否有MS OS內建的指令,因為工作的需要可能必須寫一個batch檔來用...

弟自認在茫茫網海中功力不夠無法找到相關的文件,如果大大有任何訊息還請堤供囉....:circle: thx again....




ahdeng
2004-06-17, 08:52 AM
attrib/?

TonyYang
2004-06-17, 11:56 AM
最初由 ahdeng 發表
attrib/?
Attrib是指定檔案的屬性(隱藏or唯讀等等...)
你要的指令應該是cacls

Good Luck~;)

tomjen
2004-06-17, 02:57 PM
最初由 TonyYang 發表
Attrib是指定檔案的屬性(隱藏or唯讀等等...)
你要的指令應該是cacls

Good Luck~;)

謝謝Tony兄了,小弟等等就試試看,有任何結果會再來回報請教的...thx..
:D

randy927
2004-06-17, 03:48 PM
最初由 tomjen 發表
謝謝Tony兄了,小弟等等就試試看,有任何結果會再來回報請教的...thx..
:D
Displays or modifies access control lists (ACLs) of files

CACLS filename [/T] [/E] [/C] [/G user:perm] [/R user [...]]
[/P user:perm [...]] [/D user [...]]
filename Displays ACLs.
/T Changes ACLs of specified files in
the current directory and all subdirectories.
/E Edit ACL instead of replacing it.
/C Continue on access denied errors.
/G user:perm Grant specified user access rights.
Perm can be: R Read
W Write
C Change (write)
F Full control
/R user Revoke specified user's access rights (only valid with /E).
/P user:perm Replace specified user's access rights.
Perm can be: N None
R Read
W Write
C Change (write)
F Full control
/D user Deny specified user access.
Wildcards can be used to specify more that one file in a command.
You can specify more than one user in a command.