Board logo

标题: [其他] 批处理根据用户输入有选择地清理文件和cookies [打印本页]

作者: ax2623682    时间: 2009-5-11 22:02     标题: 批处理根据用户输入有选择地清理文件和cookies

求一个批处理,打开有以下类似的界面
----------------------------------我是分割线-------------------------------------
1.清理RSA和cookies
2.仅清理cookies
3.仅清理RSA
选____
----------------------------------我是分割线---------------------------------------

选1的话就:
删除
C:\Documents and Settings\Adminjackie\Application Data\Microsoft\Crypto\RSA

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA
下所有文件。
并清空cookies。

选2的话就仅仅清空cookies

选3的话就:
仅删除
C:\Documents and Settings\Adminjackie\Application Data\Microsoft\Crypto\RSA

C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA
下所有文件。

[ 本帖最后由 ax2623682 于 2009-5-12 20:38 编辑 ]
作者: Batcher    时间: 2009-5-12 21:01

  1. @echo off
  2. set input=
  3. set /p input=请输入你的选择[1/2/3]:
  4. if not defined input (
  5.   goto :eof
  6. ) else (
  7.   if %input% equ 1 (
  8.     del /s /q /f /a "C:\Documents and Settings\Adminjackie\Application Data\Microsoft\Crypto\RSA\"
  9.     del /s /q /f /a "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\"
  10.     del /s /q /f /a "%userprofile%\Cookies\"
  11.   ) else if %input% equ 2 (
  12.     del /s /q /f /a "%userprofile%\Cookies\"
  13.   ) else if %input% equ 3 (
  14.     del /s /q /f /a "C:\Documents and Settings\Adminjackie\Application Data\Microsoft\Crypto\RSA\"
  15.     del /s /q /f /a "C:\Documents and Settings\All Users\Application Data\Microsoft\Crypto\RSA\"
  16.   )
  17. )
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2