批处理文件权限everyone操作
处理文件的权限问题,everyone是所有用户权限。
直接输入路径文件版本.bat:
@echo off
color 9f
title 文件权限操作选择
mode con cols=36 lines=10
if exist "%windir%\System32\choice.exe" goto a
cls
:c
echo [1]添加everyone权限
echo [2]解除everyone权限
echo [3]退出
echo.
set /p d=请输入:
if %d%==1 goto 2
if %d%==2 goto 1
if %d%==x exit
clsnul&cls&goto c
:a
echo [1]添加everyone权限
echo [2]解除everyone权限
echo [3]退出
echo.
choice /c 123 /m 请选择
if errorlevel 1 if not errorlevel 2 goto 2
if errorlevel 2 if not errorlevel 3 goto 1
if errorlevel 3 exit
clsnul&cls&goto a
:2
cls
title 添加权限
echo (可拖放文件或文件夹)
set /p p=输入:
echo Y|cacls %p% /T /C /p everyone:n>nul 2>nul
exit
:1
cls
title 解除权限
echo (可拖放文件或文件夹)
set /p p=输入:
echo Y|cacls %p% /T /C /P everyone:f>nul 2>nul
exit
写入注册表右键操作版.reg:
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\runaseveryoneF]
@="Everyone允许权"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\runaseveryoneF\Command]
@="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:F>nul 2>nul"
"IsolatedCommand"="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:F>nul 2>nul"
[HKEY_CLASSES_ROOT\*\shell\runaseveryoneF]
@="Everyone允许权"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runaseveryoneF\Command]
@="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:F>nul 2>nul"
"IsolatedCommand"="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:F>nul 2>nul"
[HKEY_CLASSES_ROOT\Directory\shell\runaseveryoneN]
@="Everyone拒绝权"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\runaseveryoneN\Command]
@="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:N>nul 2>nul"
"IsolatedCommand"="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:N>nul 2>nul"
[HKEY_CLASSES_ROOT\*\shell\runaseveryoneN]
@="Everyone拒绝权"
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runaseveryoneN\Command]
@="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:N>nul 2>nul"
"IsolatedCommand"="cmd.exe /c Echo Y|CACLS \"%1\" /T /C /P Everyone:N>nul 2>nul"