Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to achieve garbage removal of VBS files

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Xiaobian to share with you how to achieve the elimination of garbage VBS file, I believe most people still do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

The code is as follows:

rem made by correy

rem made at 2007.9.22

rem it can be delete you computer's the follow things(except cd,dvd)

rem it can be delete empty file and folder

rem it can be delete .tmp ._ mp .log .gid .chk .old file

rem it can be delete temp,recent,cookis,recycled,prefetch,and "Temporary Internet Files" folder.

rem i am thinking how to delete the same size and same name's file and folder

On Error GoTo 0

Set fso = CreateObject("Scripting"&". "&"FileSystem"&"Object")

for n = 1 to 3

For Each d in fso.Drives

if d.drivetype=4 then

Exit For

else

scan(d)

end if

next

next

sub scan(folder)

on error resume next

set folder=fso.getfolder(folder)

for each file in folder.files

if file.size=0 then

file.delete(true)

end if

ext=fso.GetExtensionName(file)

ext=lcase(ext)

if ext="tmp" or ext="_mp" or ext="log" or ext="gid" or ext="chk" or ext="old" then ''30

file.delete(true)

end if

next

for each subfolder in folder.subfolders

rem instrRev() can't be used,i want to find "\".

if left(subfolder.path,4)="temp" or left(subfolder.path,8)="recycled" then

subfolder.delete(true)

elseif left(subfolder.path,6)="recent" or left(subfolder.path,7)="cookis" then

subfolder.delete(true) rem 40

elseif left(subfolder.path,24)="Temporary Internet Files" or left(subfolder.path,8)="prefetch" then

subfolder.delete(true)

end if

if subfolder.size=0 then subfolder.delete(true)

scan(subfolder)

next

end sub

The above is "how to achieve the removal of garbage VBS file" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report