Home > OS >  How to change the folder permissions to TrustedInstaller under DOS
How to change the folder permissions to TrustedInstaller under DOS

Time:09-27

A win2012sever stsyem32 inside folders permissions are original TrustedInstaller then I don't know if it works after changing adm turned on the causes of now only operate under DOS want to excuse me is there a command to the folder owner back TrustedInstaller

CodePudding user response:

Relevant DOS command: Cacls. Exe

This is a Windows 2000/XP/Server 2003 operating systems can use the command, is displays or modifies file access control list, can use the wildcard in the command to specify multiple files, can also be specified on the command multiple users,
Command syntax is as follows:
Command format: Cacls filename [T]/[/b] [C]/[/G usererm] [/R user [...]] [/P usererm [...]] [/D user [...]]
Note: Filename: show the access control list (hereinafter referred to as the ACL)
Related parameters explanation:
1/t: changes the current directory and all subdirectories in the specified file ACL
2/e: edit the ACL and not replace
3/c: when access denied mistakes continue to
4,/g Userer: perm: give assigned user access, perm represent different levels of access, its value can be R (read), W (write), C (changes, write), F (full control),
5,/r user: revocation of the specified user access, pay attention to this parameter is only effective when used with "/E",
6,/p user: perm: replace the specified user access, the meaning of perm with former, but increase the option "N (not)",
7, the user/d: declined to specify the user's access,

Example:

A, check folder access control permissions
Here we want to see, for example, h: emp folder access control permissions, so only need to "start -> run" dialog box or switch to the command prompt mode, type the following command: Cacls h: emp
At this point, we can see all user groups and users of h: emp folder permissions of access control project, the CI here said the ACE will be succeeded by directory, OI said ACE will be succeeded by file, IO said ACI does not apply to the current file or directory, at the end of each row of letters control
Control permissions, such as F, C said changes, W said,
If you want to see all the files in this folder (including files in subfolders) access control permissions,
You can type "Cacls h: emp." command,

Two, modify the folder access control permissions
If you want to give the local user the user complete control of h: emp all the files in the folder and subfolders access,
Only need to type the following command: Cacls h: emp/t/e/c/g user: f
Here:
"/t" said modify all the files in the folder and subfolders ACL,
"/e" said only do editing work and not replace,
"/c" said continue when access denied error,
User: "/g f" said gives full control permissions to the local user user,
"F" is for complete control, if just want to read permissions, so should be "r",

Three, revocation of user access control permissions
If you want to cancel the user to the h: emp folder and subfolders access control permissions, you can type the following command:
Cacls h: emp/t/e/c/r user
If just refuse to user's access, so you can type the following command:
Cacls h: emp/t/e/c/d user

CodePudding user response:

Reference:

https://blog.csdn.net/lhb_blog/article/details/7063256
  • Related