求一个.bat代码

来源:百度知道 编辑:UC知道 时间:2024/06/01 13:21:54
第一行输出:删除Cookies和IE临时文件?(空行)
第二行输出:0.都不 1.Cookies 3. IE临时文件 4.Cookies和IE临时文件
然后等到按键为止,如果按0或小键盘0就跳过,按1或<Num1>则只删Cookies,3和4类推
上面无论删什么紧接着都要执行下面的语句
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\*.*"
2秒自动退出

注意del /

看看这样行吗?
@echo off
color 0b
echo 删除Cookies和IE临时文件?
echo.
echo 0.都不 1.Cookies 3. IE临时文件 4.Cookies和IE临时文件 Q. 退出
:cho
echo.
set /p choice= 请选择(0/1/3/4/Q)后按回车执行:
IF NOT "%choice%"=="" SET choice=%choice:~0,1%
if /i "%choice%"=="0" goto gogogo
if /i "%choice%"=="1" goto a1
if /i "%choice%"=="3" goto a3
if /i "%choice%"=="4" goto a4
if /i "%choice%"=="q" goto end
echo.
echo 输入错误,请重新选择
goto cho
:a1
del /f /q %userprofile%\cookies\*.*
goto gogogo
:a3
del /f /s /q %userprofile%\Local Settings\Temporary Internet Files\*.*
goto gogogo
:a4
del /f /q %userprofile%\cookies\*.*
del /f /s /q %userprofile%\Local Settings\Temporary Internet Files\*.*
goto gogogo
:gogogo
del /f /s /q %systemdrive%\