这个是你的代码:
Dim fso,finm,all
Set ws = wscript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
QQpath = ws.regread ("HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ\Install")
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
list = list & fnm & Chr(10)
End If
Next
MsgBox "已登陆过的QQ号码:" & Chr(10) & list,vbinformation,"清除QQ账号存留文件"
看看"稍微"修改的结果:
Dim fso,finm,all
Set ws = wscript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
QQpath = ws.regread ("HKEY_LOCAL_MACHINE\SOFTWARE\Tencent\QQ\Install")
Set flnm = fso.getfolder(QQpath)
Set all = flnm.subfolders
For Each path In all
Dim fnm,list
fnm = path.name
'set fs=createobject("Scripting.FileSystemObject")
'fnm=fs.getfilename(path)
'on error resume next
If IsNumeric(fnm) Then list = list & fnm & vbLf
'end if
Next
MsgBox "已登陆过的QQ号码:" & vbLf & list,vbinformation,"清除QQ账号存留文件"
Set all = Nothing
Set flnm = Nothing
Set fso = Nothing
Set ws = Nothing
你的For Each path In all太臃肿了......