0
我做了一个蝙蝠文件隐藏和取消隐藏文件夹。但我想启用/禁用它的继承。但隐藏文件后,我不能访问蝙蝠file.i想帮助修改我的蝙蝠file.Here是我的代码。蝙蝠文件隐藏/取消隐藏
@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
上面显示的代码的格式被打破。请编辑您的问题并替换整个代码部分,以便我们可以看到实际的批处理文件。 – foxidrive 2014-10-18 11:16:15
您可以重新排列代码,以便先禁用继承吗? – RGuggisberg 2014-10-18 14:21:18
@ArunaTelshan为了格式化代码,您可以在每行前面放置四个空格,如[我如何使用Markdown或HTML格式化我的帖子](http://stackoverflow.com/help/formatting)中所述 – 2014-10-18 16:12:35