回复 5# Batcher - PUSHD %~DP0 &TITLE 清理sewwo教学程序日志淤积(赖渊)
- @echo off&chcp 437>nul&setlocal enabledelayedexpansion
- color 0a
-
- for /f "delims=" %%l in ('dir "%userprofile%\AppData\Roaming\Seewo" /a /s /-c ^| findstr /i "bytes$"') do (
- for /f "tokens=3 delims= " %%a in ("%%l") do (set 1=%%a)
- )
- echo !1! bytes %统计大小%
-
- set num=0
- for /f "delims=" %%i in ('dir %userprofile%\AppData\Roaming\Seewo%1 /a-d /b /s') do @set /a num1+=1 %统计数目%
- ::第一次计算用户目录sewwo日志目录文件个数及大小
-
- for /f "delims=" %%l in ('dir "%systemdrive%\ProgramData\Seewo" /a /s /-c ^| findstr /i "bytes$"') do (
- for /f "tokens=3 delims= " %%a in ("%%l") do (set 2=%%a)
- )
- echo !2! bytes%统计大小%
-
- set num=0
- for /f "delims=" %%i in ('dir %systemdrive%\ProgramData\Seewo%1 /a-d /b /s') do @set /a num2+=1 %统计数目%
- ::第一次计算系统目录sewwo日志目录文件个数及大小
-
- call :jia !1! !2! dx1
- echo %dx1% bytse
-
- call :jia %num1% %num2% sm1
- echo %sm1%
-
- ::第一次调用加法函数统计删除前日志目录总文件数及大小
-
- @ echo on
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\EasiAssistant"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\EasiCamera\Log"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\EasiNote3C\Log"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\EasiNote5\Log"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\EasiRecorder\logs"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\ECGuardian\Log"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoAdClose"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoLink\logs"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoLinkService\logs"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoService"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoService5"
-
- del /s /q "%userprofile%\Desktop\Seewo\logs
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\SeewoServiceUpdater"
-
- del /s /q "%userprofile%\AppData\Roaming\Seewo\UpgraderTo41"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\SeewoAdminService"
-
- del /s /q "%userprofile%\Desktop\Seewo\SeewoAdminService"
-
- del /s /q "%userprofile%\Desktop\Seewo\Easiupdate\easiupdate\logs"
-
- del /s /q "%userprofile%\Desktop\Seewo\SeewoGuard"
-
- del /s /q "%userprofile%\Desktop\Seewo\Easiupdate3Logs"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\SeewoGuard"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\Easiupdate3Logs"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\logs"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\LiveProxyGuard"
-
- del /s /q "%systemdrive%\ProgramData\Seewo\Easiupdate\easiupdate\logs"
-
- ::清理sewwo教学程序淤积日志文件
-
- ping 127.0.0.1 -n 2 >nul
-
- color 0C
-
- net stop wuauserv
-
- del /s /q "%systemdrive%\Windows\SoftwareDistribution\DataStore
-
- color 0a
-
- ping 127.0.0.1 -n 2 >nul
-
- net start wuauserv
-
- @ echo off
-
- for /f "delims=" %%l in ('dir "%userprofile%\AppData\Roaming\Seewo" /a /s /-c ^| findstr /i "bytes$"') do (
- for /f "tokens=3 delims= " %%a in ("%%l") do (set 3=%%a)
- )
- echo !3! bytes %统计大小%
-
- set num=0
- for /f "delims=" %%i in ('dir F:\%1 /a-d /b /s') do @set /a num3+=1 %统计数目%
- ::第二次计算用户目录sewwo日志目录文件个数及大小
-
- for /f "delims=" %%l in ('dir "D:\" /a /s /-c ^| findstr /i "bytes$"') do (
- for /f "tokens=3 delims= " %%a in ("%%l") do (set 4=%%a)
- )
- echo !4! bytes %统计大小%
-
- set num=0
- for /f "delims=" %%i in ('dir %systemdrive%\ProgramData\Seewo%1 /a-d /b /s') do @set /a num4+=1 %统计数目%
- ::第二次计算系统目录sewwo日志目录文件个数及大小
-
- call :jia !3! !4! dx2
- echo %dx2% bytse
-
- call :jia %num3% %num4% sm2
- echo %sm2%
-
- ::第二次调用加法函数统计删除后日志目录文件数及总大小
-
- call :jian %dx1% %dx2% dx3
- echo %dx3% bytse
- ::计算前后空间减少的大小
-
- call :jian %sm1% %sm2% sm3
- echo %sm3%
- ::计算前后文件减少的数目
-
- for /f %%i in ('powershell -c "%dx1% /1024 /1024"') do (
- set "q=%%i"
- echo %q%
-
- set /a a=%dx2%,b=1048576
- set /a result=%a%/%b%
- echo %a%/%b%=%h%
- set /a a=%dx3%,b=1048576
- set /a result=%a%/%b%
- echo %a%/%b%=%t%
- ::bytes转换成MB
-
- CHCP 936>nul
- Cls
- @ echo.
- echo 清理前%q%MB,清理后%h%MB,共清理了%t%MB,总共%sm3%个文件
- echo laiyuanys.ys168.com
- pause > nul
-
-
- :jia 加法计算函数
- setlocal enabledelayedexpansion&set f=&set "t="
- set var1=%~1&set var2=%~2&set /a j=0,n1=0,n2=0
- for /l %%a in (0 1 9) do (set vard1=&set "vard2="
- set var1=!var1:%%a= %%a !&set var2=!var2:%%a= %%a !)
- for %%a in (!var1!)do (set/a n1+=1&set vard1=%%a !vard1!)
- for %%a in (!var2!)do (set/a n2+=1&set vard2=%%a !vard2!)
- (if !n1! lss !n2! (set var1=%var2%&set "var2=%var1%"
- set vard1=%vard2%&set vard2=%vard1%))&set "var2=!var2: =!"
- for %%a in (!vard1!) do (if "!var2!"=="" set /a var2=0
- set /a a=%%a+!var2:~-1!+j&set t=!a:~-1!!t!&set "a=0!a!"
- set "j=!a:~-2,1!"&set var2=!var2:~0,-1!)
- if !j! neq 0 set "t=!j!!t!"
- Endlocal&set %~3=%t%&goto :EOF
-
- :jian 减法计算函数
- setlocal enabledelayedexpansion&&set t=&set f=&set "lin="
- for /l %%a in (1 1 10) do set "lin=0000000000!lin!"
- set lin=!lin!!lin!!lin!!lin!!lin!&set "lin=!lin!!lin!"
- set var1=!lin!%~1&set var2=!lin!%~2&set vard1=&set/a j=0
- set var1=!var1:~-1000!&set "var2=!var2:~-1000!"
- if "!var1!" lss "!var2!" (set var1=%~2&set "var2=%~1"
- set "f=-") else set var1=%~1&set "var2=%~2"
- for /l %%a in (0 1 9) do set "var1=!var1:%%a= %%a !"
- for %%a in (!var1!) do set "vard1=%%a !vard1!"
- for %%a in (!vard1!) do (if "!var2!"=="" set/a var2=0
- set /a a=%%a-j,b=!var2:~-1!
- if !a! lss !b! (set /a a+=10,j=1)else set /a j=0
- set /a w=a-b&set t=!w!!t!&set var2=!var2:~0,-1!)
- for /f "tokens=* delims=0" %%a in ("!t!") do (
- if "%%a"=="" (set t=0) else set "t=%%a")
- Endlocal&set %~3=%f%%t%&goto :EOF
复制代码 修改成- for /f %%i in ('powershell -c "%dx1% /1024 /1024"') do (
- set "q=%%i"
- echo %q%
复制代码 就不执行下面的运算函数而是直接退出
我尝试添加复制代码 来看看运行过程也都是直接退出。。。。 |