- @echo off
- cd /d "%~dp0"
- set dir0="test"
- if not exist %dir0% exit /b
- for /f "delims=:" %%A in ('attrib %dir0%') do (
- setlocal enabledelayedexpansion
- set attr=%%A
- set "attr=!attr:~,-1!"
- echo "!attr!"|find /i "H">nul
- if !errorlevel! gtr 0 (
- attrib +h %dir0% /d
- ) else (
- attrib -h %dir0% /d
- )
- endlocal
- )
- pause
- exit /b
复制代码
|