做了个清理chrome垃圾的批处理,代码如下:- @echo off
- title %~n0
-
- if exist "%userprofile%\Local Settings\Application Data\Google\Chrome" (
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Archived*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Cookies*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*History*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Index*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*journal*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Links*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Session*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Shortcuts*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Sites*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*Tabs*" >nul 2>nul
- del/f/q/s/a "%userprofile%\Local Settings\Application Data\Google\Chrome\User Data\*.bak" >nul 2>nul
-
- for /f "delims=" %%a in ('dir/ad/b/s "%userprofile%\local settings\application data\google\chrome\*cache*"') do (if exist "%%a" rd/q/s "%%a")>NUL 2>NUL
- for /f "delims=" %%b in ('dir/ad/b/s "%userprofile%\local settings\application data\google\chrome\*databases*"') do (if exist "%%b" rd/q/s "%%b")>NUL 2>NUL
- for /f "delims=" %%c in ('dir/ad/b/s "%userprofile%\local settings\application data\google\chrome\*Local Storage*"') do (if exist "%%c" rd/q/s "%%c")>NUL 2>NUL
- for /f "delims=" %%d in ('dir/ad/b/s "%userprofile%\local settings\application data\google\chrome\*Media Cache*"') do (if exist "%%d" rd/q/s "%%d")>NUL 2>NUL
- )
- pause
复制代码 我的问题是:为何在Windows环境可以正常清理垃圾的这个代码,放在开关机脚本中运行却没有效果呢? |