6:实战使用
======================
本篇文章版权归作者所有
======================
@echo off&color 2f&mode con: cols=35 lines=5
cls
:xt
echo.
echo =批处理小系统=
echo.
echo [1:关机 2:写入文档]
echo [3:清理垃圾]
set /p sz=
if "%sz%"=="1" goto gj
if "%sz%"=="2" goto xie
if "%sz%"=="3" goto ql
cls
echo 输入错误
ping /n 2 127.0.0.1 >nul
goto xt
:gj
echo 确认? [y/n]
set /p qrd=
if "%qrd%"=="y" goto gj
if "%qrd%"=="n" goto xt
cls
echo 输入错误
ping /n 2 127.0.0.1 >nul
goto xt
:gj
shutdown -s -f -t 0
goto die
:xie
cls
echo 不想打了输ok回去
echo.
set /p d=
if "%d%"=="ok" goto xt
echo ----------------------- >>bat打字.txt
echo %d%>>bat打字.txt
:f
echo.
set /p h=
if "%h%"=="ok" goto xt
echo %h%>>bat打字.txt
goto f
:ql
cls
echo 准备清理系统垃圾....
ping /n 3 127.0.0.1 >nul
del /f /s /q %systemdrive%\*.tmp&del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log&del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk&del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*&del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*&rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*&del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
cls
echo 清理完成!
ping /n 2 127.0.0.1 >nul
goto xt
===============
是不是第一此看到就放弃了?
其实逐句的看,其实很轻松
===============