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-06-22 17:54
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Clear QQ Root Directory Account Folder - VBS Version View 3,081 Replies 18
Original Poster Posted 2007-04-21 00:56 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
I saw a problem that a fellow needed to solve yesterday, but today the post can't be found


'Please modify the location of the QQ folder in the program by yourself.
'No matter whether it is 8-digit or 9-digit, any folder with a numeric name will be deleted!
'By the way, recently Chinese TV dramas are getting more and more tasteless!
dim fso,finm,all
set fso=createobject("scripting.filesystemobject")
set flnm=fso.getfolder("C:\Program Files\QQ2006")
set all=flnm.subfolders


for each path in all
dim fs,fnm
set fs=createobject("scripting.filesystemobject")
fnm=fs.getfilename(path)

on error resume next
fnm=int(fnm)
if err.number<>13 then
dim list
fs.deletefolder(path)
list=list&fnm&chr(10)
end if
next
msgbox "Deleted QQ number folders:"&chr(10)&list,vbinformation,"Clear QQ account remaining files"
Floor 2 Posted 2007-04-21 02:43 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
for /f %i in ('dir /ad /b^|findstr /v /b /e [0-9]^|findstr /r /b /e [0-9]*[0-9]') do echo %i
I also wrote one
Floor 3 Posted 2007-04-21 02:52 ·  中国 新疆 乌鲁木齐 电信
高级用户
★★★
Autowalk
Credits 845
Posts 375
Joined 2007-03-03 01:58
19-year member
UID 80606
Gender Male
Status Offline
....My effect looks good ~_~
Floor 4 Posted 2007-04-21 03:02 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Hehe, because I can't write it with VBS
Floor 5 Posted 2007-04-21 03:35 ·  中国 广东 广州 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Hehe, but the code on the 2nd floor is very short :)
知,不觉多。不知,乃求知
Floor 6 Posted 2007-04-21 03:38 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
Heh
Floor 7 Posted 2007-04-21 03:40 ·  中国 广东 广州 电信
银牌会员
★★★
Credits 1,206
Posts 517
Joined 2007-03-25 01:18
19-year member
UID 82819
Gender Male
Status Offline
Each to his own taste...

One is pretty, the other is simple. If only the two could be combined together : )
知,不觉多。不知,乃求知
Floor 8 Posted 2007-04-21 05:08 ·  中国 河北 保定 联通
银牌会员
★★★
Credits 1,513
Posts 554
Joined 2005-12-30 00:50
20-year member
UID 48180
Gender Male
Status Offline
Lazy, so a small suggestion, it's best to be able to automatically search paths. Otherwise, by the time you enter the path, you could have manually deleted it all.
Floor 9 Posted 2007-04-21 05:13 ·  中国 安徽 芜湖 电信
高级用户
★★★
Credits 866
Posts 415
Joined 2005-12-04 11:19
20-year member
UID 46459
Status Offline
I don't understand, I'm a VBS novice. I want to learn but can't get into it.
欢迎你到批处理爱好者联盟QQ群:18023953
Floor 10 Posted 2007-04-21 05:36 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
Brother everest79's code is very impressive. After testing, it can achieve the effect. I hope to have a detailed explanation. I also tried to write this batch script yesterday, but because I was too inexperienced, I didn't continue writing it later. Please give comments, thank you in advance.
Floor 11 Posted 2007-04-21 05:38 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 2,000
Posts 621
Joined 2007-01-01 00:00
19-year member
UID 75212
Gender Male
Status Offline
Can read the path from the registry
Floor 12 Posted 2007-04-21 06:49 ·  中国 广东 广州 天河区 电信
金牌会员
★★★★
一叶枝头,万树皆春
Credits 2,564
Posts 1,127
Joined 2006-12-25 22:57
19-year member
UID 74552
Gender Male
Status Offline
for /f %i in ('dir /ad /b^|findstr /v /b /e [0-9]^|findstr /r /b /e [0-9]*[0-9]') do echo %i

findstr /v /b /e [0-9] This one is used to filter directories starting with 0
findstr /r /b /e [0-9]*[0-9] This filters the directory names filtered in the previous step again, and the result this time is all QQ number directories

Hehe, actually this is not safe. If there is none, it may delete the entire directory
Floor 13 Posted 2007-04-21 07:01 ·  中国 上海 浦东新区 电信
中级用户
★★
Credits 302
Posts 138
Joined 2007-03-29 02:33
19-year member
UID 83224
Gender Male
Status Offline
First, mark it. I'll study it when I'm free. When I come back, I'll continue to ask questions. (^ _^)
Floor 14 Posted 2007-04-21 09:40 ·  中国 河北 石家庄 联通
初级用户
Credits 27
Posts 13
Joined 2006-12-11 04:34
19-year member
UID 73157
Gender Male
Status Offline
HKLM\SOFTWARE\Tencent\QQ\Install

Here it can be automatically integrated into the path
Floor 15 Posted 2007-04-21 11:49 ·  中国 北京 宽捷网通信技术有限公司
初级用户
Credits 84
Posts 28
Joined 2006-05-03 22:36
20-year member
UID 54894
Gender Male
Status Offline
Mix the building owner's post and the 14th floor's post together to earn some points, heh

DIm regQQpath,objShell,QQpath
Dim fso,finm,all

regQQpath = "HKLM\Software\Tencent\QQ\Install"
Set objShell = CreateObject("WScript.Shell")
QQpath = objShell.regRead(regQQpath)

set fso=createobject("scripting.filesystemobject")
set flnm=fso.getfolder(QQpath)
set all=flnm.subfolders


for each path in all
dim fs,fnm
set fs=createobject("scripting.filesystemobject")
fnm=fs.getfilename(path)

on error resume next
fnm=int(fnm)
if err.number<>13 then
dim list
fs.deletefolder(path)
list=list&fnm&chr(10)
end if
next
msgbox "已删除的QQ号码文件夹:"&chr(10)&list,vbinformation,"清除QQ账号存留文件"
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
zhoushijay +4 2007-04-22 00:36
Forum Jump: