Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Batch modification and assignment of user and folder permissions by Icacls (2)

2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

In the previous article we talked about simple add, modify, delete, batch folder permissions granted to a single user.

Below we will use scripts to batch process our folder permissions

Create a new 1.bat script on disk D to store the code

The script is roughly as follows: @echo offfer/f "skip=1 eol=; token=1-6 delims=," %%a in (d:\1234\1234.cvs) do icacls %%a %%b %%c%%d %e %%f /Tpause Some basic explanations of script: "skip=1 eol=; token=1-6 delims=,"skip=1 Skip the first line: the first line sets Chinese slogan folder user permission registration eol=; The behavior at the beginning of the semicolon comment line token=1-6 Assign variables %%a, %%b, %%c,%%d,%%e,%%fdelims=, comma separator %%a Column A of the corresponding table %%b Column B of the corresponding table %%c Column C of the corresponding table mainly contains %%c%%d directly without spaces. %% d Column D of the corresponding table %%e Column E of the corresponding table %%f Column F of the corresponding table

Add a file of 1234.cvs to d:\1234 and write the following data. Later, you can adjust it according to the needs of the child.

Here's an example: Grant 999 read permissions to folder 12

Delete 999 permissions for folder 13

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report