China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-29 10:57
中国DOS联盟论坛 » 论坛回收站 » Questions in Batch Script View 1,894 Replies 1
Original Poster Posted 2009-11-16 21:56 ·  中国 陕西 西安 教育网
新手上路
Credits 7
Posts 5
Joined 2009-10-18 10:25
16-year member
UID 153255
Gender Male
Status Offline
### 1, What is the role of modifying the ACL with Cacls?
The role of using `Cacls %1 /c /t /p Everyone:f` is to take ownership and grant full control permissions to the `Everyone` group for the file or directory specified by `%1`. This is to ensure that the file or directory can be deleted later because sometimes files or directories have restricted permissions that prevent normal deletion.

### 2, When dragging to the batch file, is it equivalent to using %1 to replace the path of the file to be deleted?
Yes, when you drag a file to the batch file, `%1` is indeed used to substitute the path of the file that is dragged.

### 3, What is the significance of the slashes in `\\?\%1`
In the path `\\?\%1`, the double slashes at the beginning are part of the Windows long - path syntax. The `\\?\` prefix is used to enable the use of long paths that exceed the normal maximum path length limit in Windows. It allows the operating system to handle paths that are longer than the traditional 260 - character limit.
Floor 2 Posted 2009-11-17 02:24 ·  中国 湖南 郴州 电信
新手上路
Credits 4
Posts 4
Joined 2009-09-12 07:30
16-year member
UID 151888
Gender Male
Status Offline
Not all files can be deleted.
1. Modify the ACL with cacls, which should modify the access permissions in the ACL data packet. Sometimes when we delete a file, if the program in that file is being used by the computer. Then the computer will prompt us that the file is not in use or write-protected. This batch processing is to delete those files (virus files) that the computer is using but we can't close manually. As long as we change the permissions of the ACL data packet information, we can delete the file.
2. Yes
3. \\? wildcard
\\ is precise
? is any character \\? combined, that is, precise to any character
When dragging the file to be deleted to this batch processing, it replaces "?"
Forum Jump: