我为隐藏和取消隐藏文件夹制作了一个bat文件。但我想启用/禁用继承。但是隐藏文件后我无法访问bat文件。我想帮助修改我的bat文件,这是我的代码。
@ECHO off
cls
:start
echo hide. all files in this folder
echo unhide. all files in this folder
set /p choice=Type the what do you want to do?
if '%choice%'=='hide' goto hide
if '%choice%'=='unhide' goto unhide
if not '%choice%'=='hide' if not '%choice%'=='unhide' goto :error
:hide
attrib /d /s +s +h
attrib /d /s -s -h unhide.bat
icacls "%CD%" /T /inheritance:r
goto :qqq
:unhide
attrib /d /s -s -h
icacls "%CD%" /T /inheritance:e
goto :aaa :qqq echo "File hide successful" goto end
:aaa
echo "File unhide successful"
goto end
:error
echo "please enter correct command"
goto:start
:end
pause
试试这个进入CMD.exe。
attrib -h file.bat
如果file.bat是您的可执行文件,则只会被隐藏,因此您可以通过此操作将其取消隐藏。
只需将file.bat替换为您需要取消隐藏的批处理文件即可。
-品客
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句