我想切换具有相应属性-h
& +h
的目录。在批处理文件中创建切换“切换”
当我使用这个命令序列输出
\directory was unexpected at the time.
如何得到这个工作任何想法?
:toggle
if attrib \directory /s /d equ -h goto hidedir
if attrib \directory /s /d equ +h goto showdir
pause
goto start
:showdir
attrib -r -s -h \directory /s /d
goto start
:hidedir
attrib +r +s +h \directory /s /d
goto start
你可以'attrib'命令不使用'IF',你需要一个'FOR ... LOOP'像这样:http://stackoverflow.com/questions/18658509/how-to-get-attributes-ofa-a-文件使用批处理文件 – LittleBobbyTables 2014-10-03 15:42:11