China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 00:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Computer Junk Cleanup Assistant View 10,210 Replies 60
Original Poster Posted 2007-01-20 00:34 ·  中国 湖南 永州 电信
初级用户
Credits 83
Posts 32
Joined 2006-12-26 05:27
19-year member
UID 74585
Gender Male
Status Offline
In the forum, someone spent some time reading posts, searching for materials, and then started writing this code. Hehe, just started learning not long ago, many things are not understood. There's no way, some are imitating the functions by referring to the codes of capable people in the forum. Also encountered many difficulties during the testing process (for me, a newbie), so the code is a bit redundant and has bugs. There's also the problem of not being able to clear some junk files: such as:
All files under "%userprofile%\Local Settings\History\" and the files in the recycle bin (tried it and it works, but the recycle bin icon on the desktop still has files, and it's empty when opened! So didn't add this part of the code), hope everyone can solve this problem, thank you!
The so-called way of programming is to use the most concise code to achieve powerful functions. This goal is still quite far away for me...
Hope capable people in the forum can point out the deficiencies and errors. Of course, there may be errors and deficiencies in the database, and also hope everyone can correct and add, thank you!!!
Because my IE may have problems, so the code segment can only be written like this. If possible, please let the moderator correct it, thank you.

code:


@echo off
@color 2e
@title Computer Cleaning Assistant 2007 v1.0 BY Celinkot
@cls
@echo ================================================================================
@echo {※※※(⊙﹏⊙)※※※(⊙﹏⊙)※※※H(⊙﹏⊙)N※※※(⊙﹏⊙)※※※(⊙﹏⊙)※※※}
@echo ================================================================================
@echo ╔+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++╗
@echo ┆ This software is made by "Silinkot", please scan for viruses before use! ┆
@echo ┆ ┆
@echo ┆ If you are not satisfied, please delete it in time. ┆
@echo ┆ ┆
@echo ┆ ♂Celinkot♂ ┆
@echo ┆ ┆
@echo ┆ QQ:523963001 ┆
@echo ┆ ┆
@echo ┆ @:huseyzhncn ┆
@echo ╚+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++╝
@echo.
@echo §﹌﹌﹌﹌﹌﹌﹌ Hope everyone have a happy life in the world ! ﹌﹌﹌﹌﹌﹌﹌§
@echo.
@echo This software is currently applicable to Windows XP, please test it yourself for other systems!
@echo.
@echo Garbage cleaning will occupy a certain amount of memory and CPU, and the CPU usage may reach 100%
@echo.
@echo Please close some programs that are in use!
@echo.
@echo ******************************* Please press any key to start! ******************************
@echo.
@pause>nul

@if not exist slkt.ini goto cw
@if not exist %systemroot%\system32\slkt.ini goto fz
@:fz
@copy slkt.ini %systemroot%\system32\
@goto xuanze

@:cw
@cls
@echo Error!!! The database file slkt.ini was not found!
@pause
@goto kl

@:xuanze
@cls
@set /p slkt= Continue/Quit ( Y / N )
@if %slkt%==Y goto kaishi
@if %slkt%==N goto jieshu
@echo Error!!! Please pay attention to case, whether the key value exists......&pause
@goto xuanze
@cls

@:kaishi
@cls
@color 3A
@echo ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
@echo ┃ Operation Instructions ┃
@echo ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
@echo ┃ Full disk cleaning please press: AP ┃
@echo ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
@echo ┃ Clean C drive please press: C Clean D drive please press: D ┃
@echo ┃ Clean E drive please press: E Clean F drive please press: F ┃
@echo ┃ Clean G drive please press: G Clean H drive please press: H ┃
@echo ┃ Clean I drive please press: I Clean J drive please press: J ┃
@echo ┃ Clean K drive please press: K Clean L drive please press: L ┃
@echo ┃ Clean M drive please press: M Clean N drive please press: N ┃
@echo ┃ Clean O drive please press: O Clean P drive please press: P ┃
@echo ┃ Clean Q drive please press: Q Clean R drive please press: R ┃
@echo ┃ Clean S drive please press: S Clean T drive please press: T ┃
@echo ┃ Clean USB drive please press: U Clean V drive please press: V ┃
@echo ┃ Clean W drive please press: W Clean X drive please press: X ┃
@echo ┃ Clean Y drive please press: Y Clean Z drive please press: Z ┃
@echo ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
@echo ┃ Quit please press: QT ┃
@echo ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
@echo ┃ Terminate the program midway please press: Ctrl+C ┃
@echo ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
@set /p clkt=
@if "%clkt%"=="C" goto qc
@if "%clkt%"=="D" goto qd
@if "%clkt%"=="E" goto qe
@if "%clkt%"=="F" goto qf
@if "%clkt%"=="G" goto qg
@if "%clkt%"=="H" goto qh
@if "%clkt%"=="I" goto qi
@if "%clkt%"=="J" goto qj
@if "%clkt%"=="K" goto qk
@if "%clkt%"=="L" goto ql
@if "%clkt%"=="M" goto qm
@if "%clkt%"=="N" goto qn
@if "%clkt%"=="O" goto qo
@if "%clkt%"=="P" goto qp
@if "%clkt%"=="Q" goto qq
@if "%clkt%"=="R" goto qr
@if "%clkt%"=="S" goto qs
@if "%clkt%"=="T" goto qt
@if "%clkt%"=="U" goto qu
@if "%clkt%"=="V" goto qv
@if "%clkt%"=="W" goto qw
@if "%clkt%"=="X" goto qx
@if "%clkt%"=="Y" goto qy
@if "%clkt%"=="Z" goto qz
@if "%clkt%"=="AP" goto ap
@if "%clkt%"=="QT" goto end
@echo Error!!! Please pay attention to case, whether the key value exists...&pause
@cls
@goto kaishi

@:qc
@goto clkt4

@:qd
@goto clkt4

@:qe
@goto clkt4

@:qf
@goto clkt4

@:qg
@goto clkt4

@:qh
@goto clkt4

@:qi
@goto clkt4

@:qj
@goto clkt4

@:qk
@goto clkt4

@:ql
@goto clkt4

@:qm
@goto clkt4

@:qn
@goto clkt4

@:qo
@goto clkt4

@:qp
@goto clkt4

@:qq
@goto clkt4

@:qr
@goto clkt4

@:qs
@goto clkt4

@:qt
@goto clkt4

@:qu
@goto clkt4

@:qv
@goto clkt4

@:qw
@goto clkt4

@:qx
@goto clkt4

@:qy
@goto clkt4

@:qz
@goto clkt4

@:clkt1
@cls
@%clkt%:
@cd /
@echo You selected drive %clkt%
@if /i %clkt%: equ %systemdrive% goto clkt2
@goto clkt3

@:clkt2
@echo This drive is the system drive&pause
@goto clkt9

@:clkt3
@echo This drive is not the system drive&pause
@goto clkt6

@:clkt4
@if /i exist %clkt%:\nul goto :clkt1
@echo This drive does not exist&pause
@goto kaishi

@:clkt9
@del /f /s /q "%userprofile%\Local Settings\Temp\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\recent\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\Local Settings\Tempor~1\*.*" 2>nul 3>nul
@if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.* 2>nul 3>nul
@del /f /s /q "%allusersprofile%\Documents\DrWatson\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\Application Data\Microsoft\Office\Recent\*.lnk" 2>nul 3>nul
@HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f>nul 2>nul
@taskkill /im explorer.exe /f > nul
@del /s /f /a /q "%userprofile%"\Local Settings\History\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\cookies\*.*" 2>nul 3>nul
@start "" explorer.exe

@:clkt6
@cls
@%clkt%:
@cd /
@echo Searching for garbage files on drive %clkt%, please wait...
@for /f %%i in (%systemroot%\system32\slkt.ini) do del /s /f /q %%i 2>nul
@echo Done!!!
@echo. & pause
@cls
@goto kaishi

@:clkt5
@del /f /s /q "%userprofile%\Local Settings\Temp\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\recent\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\Local Settings\Tempor~1\*.*" 2>nul 3>nul
@if not exist %SystemRoot%\Minidump\NUL del /f /q /s %SystemRoot%\Minidump\*.* 2>nul 3>nul
@del /f /s /q "%allusersprofile%\Documents\DrWatson\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\Application Data\Microsoft\Office\Recent\*.lnk" 2>nul 3>nul
@HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU /va /f>nul 2>nul
@taskkill /im explorer.exe /f > nul
@del /s /f /a /q "%userprofile%"\Local Settings\History\*.*" 2>nul 3>nul
@del /f /s /q "%userprofile%\cookies\*.*" 2>nul 3>nul
@start "" explorer.exe
goto :eof

@:clkt7
@cls
@%clkts%:
@cd /
@echo Searching for garbage files on drive %clkts%, please wait...
@for /f %%i in (%systemroot%\system32\slkt.ini) do del /s /f /q %%i 2>nul
@echo Done!!!
@echo. & pause
@cls
@goto eof

@:ap
@for %%p in (c d e f g h i j k l m n o p q r s t u v w x y z) do set clkts=%%p&call :clkt8
@echo Cleaning completed!!!
@echo. & pause
@goto kaishi

@:sjk
@if /i %clkts%: equ %systemdrive% call :clkt5
@goto :clkt7

@:clkt8
@if /i exist %clkts%:\nul goto sjk
@echo This drive does not exist
@goto :eof

@:end
@exist

@:kl
@del %0

[ Last edited by Mekinery on 2007-1-19 at 12:10 PM ]
Attachments
clkt.rar (2.4 KiB, Credits to download 1 pts, Downloads: 184)
Floor 2 Posted 2007-01-20 00:58 ·  中国 安徽 合肥 电信
新手上路
Credits 2
Posts 1
Joined 2007-01-09 02:44
19-year member
UID 75893
Gender Male
Status Offline
Purely support the LZ, but still feel it's making a mountain out of a molehill.

Actually, only the system disk needs to clean up garbage:
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
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\*.*"

Other disks are completely unnecessary!

[ Last edited by Pando on 2007-1-20 at 01:15 AM ]
Floor 3 Posted 2007-01-20 01:15 ·  中国 北京 联通
银牌会员
★★★
努力做坏人
Credits 1,185
Posts 438
Joined 2006-08-28 12:00
19-year member
UID 61449
From 北京
Status Offline
Hey, it's just pure manual labor.......
我今后在论坛的目标就是做个超级坏人!!!
Floor 4 Posted 2007-01-20 01:32 ·  中国 湖南 永州 电信
初级用户
Credits 83
Posts 32
Joined 2006-12-26 05:27
19-year member
UID 74585
Gender Male
Status Offline
It's not entirely like that. Except for the system disk, it's a bit hard to say about the garbage generated by other software.
This is a bit scary, but the function shouldn't be too bad, right?
There are still places for improvement in it. With my current ability, I can't do it yet. Please everyone give pointers and write concise code. Thanks here!
Floor 5 Posted 2007-01-20 01:34 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 6 Posted 2007-01-20 01:42 ·  中国 湖南 永州 电信
初级用户
Credits 83
Posts 32
Joined 2006-12-26 05:27
19-year member
UID 74585
Gender Male
Status Offline
electronixtar is mostly right. It's indeed similar. Actually, everything everyone has learned is "copied with Ctrl+V", just in different forms.
Because I think everyone goes from not knowing to knowing, becoming proficient and then flexibly applying it.
There are really few who truly come up with "non-existent" things by themselves. After all, there are few people like Einstein...
----Personal view
Do you all think so?

[ Last edited by Mekinery on 2007-1-19 at 12:45 PM ]
Floor 7 Posted 2007-01-20 02:41 ·  中国 河北 石家庄 电信
初级用户
Credits 49
Posts 25
Joined 2006-12-08 03:22
19-year member
UID 72877
Gender Male
Status Offline
Agree with the view of the person above!
How can we progress without learning? Copying is a shortcut to learning!!
Floor 8 Posted 2007-01-20 02:43 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
Still support, hehe~~~

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Floor 9 Posted 2007-01-20 12:26 ·  中国 广东 广州 海珠区 电信
中级用户
★★
Credits 326
Posts 148
Joined 2005-12-16 12:30
20-year member
UID 47260
Gender Male
Status Offline
Floor 10 Posted 2007-01-23 08:02 ·  中国 广西 南宁 电信
初级用户
Credits 63
Posts 26
Joined 2006-12-31 00:38
19-year member
UID 75041
Gender Male
Status Offline
Not bad, worthy of learning
Floor 11 Posted 2007-01-25 05:46 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
This code is written like an eighty-year-old old woman. I really admire the LZ's spirit.
Floor 12 Posted 2007-03-18 08:14 ·  中国 广东 潮州 电信
初级用户
Credits 23
Posts 10
Joined 2006-10-23 13:03
19-year member
UID 67889
Gender Male
Status Offline
Supported.I can't understand.
Floor 13 Posted 2007-03-18 08:26 ·  中国 广东 广州 电信
高级用户
★★★
中國DOS聯盟常任參議员
Credits 686
Posts 318
Joined 2005-11-04 13:00
20-year member
UID 77577
Gender Male
Status Offline
The spirit is worthy of serious support~~
. 繽紛色彩閃出的美麗是因為它沒有分開每種色彩...>/

我的百度空间: BEYOND超越 为什么用DOS
Floor 14 Posted 2007-03-19 11:04 ·  中国 山西 运城 电信
新手上路
Credits 5
Posts 3
Joined 2006-01-16 22:06
20-year member
UID 49090
Status Offline
Thanks to the LZ and everyone for sharing
Floor 15 Posted 2007-04-06 06:22 ·  中国 四川 成都 电信
新手上路
Credits 4
Posts 2
Joined 2006-10-28 10:31
19-year member
UID 68648
Gender Male
Status Offline
Learn, thanks for sharing
1 2 3 5 Next ›
Forum Jump: