【VB开源代码栏目提醒】:网学会员,鉴于大家对VB开源代码十分关注,论文会员在此为大家搜集整理了“如何删除脚本病毒,删除文件的批处理文件 删除文件夹的VB程序 - 综合课件”一文,供大家参考学习!
????????????±??????????????. ????????·????????????????ü??????ò???? ????????????·??????????autorun.inf ??????????????????????????????????????????????????????????????????????¤????????????????. ??????????ó??????????????????ú????????????????. ??????????????¨??????????????ú??????í???????????????? del ????·??autorun.inf ???????? ???????????? ??????????????????????ò: 1????×??????????????????????×??????????autorun. echo off del /f/s /q systemdrive.tmp del /f/s /q systemdrive._mp rem ??????????????????????ù????log??ó×????????????????????????????????????à????????????????????????????????????????????????????±????????????????????ò????°??×°??????????????ù????rem????????????????????????????????????°??rem???????????????????? rem del /f/s /q systemdrive.log del /f/s /q systemdrive.gid del /f/s /q systemdrive.chk del /f/s /q systemdrive.old del /f/s /q windir.bak del /f/s /q systemdriverecycled/. del /f/s /q windirprefetch. rd /s/q windirtemp md windirtemp rd /s/q temp md temp del /f/q userprofilecookies. del /f/q userprofilerecent. rd /s/q userprofileLocal SettingsTemporary Internet Files cls echo ??????????????????????????ê???????????? echo. pause 2 Option Explicit On Error Resume Next If WScript.Arguments.Count 2 Then ShowUsage WScript.Quit Else ??????????¨??????????????????????????????é????·?????????????????????????? Dim strComputer Dim objWMIService Dim colFiles Dim objFSO strComputer . ????±????????????????ú????????????????±?? Set objWMIService GetObjectwinmgmts: _ impersonationLevelimpersonate _ strComputer rootcimv2 Dim WMISql WMISql Select from CIM_DataFile where Path _ WScript.Arguments.Named.ItemPath AND Drive _ WScript.Arguments.Named.ItemDriver Set colFiles objWMIService.ExecQueryWMISql ??????????ú×?????????????????????? ????????±????????????÷??±??°??·??????????????????????????????????????÷×?????????? Set objFSO CreateObjectScripting.FileSystemObject Dim strWMIDate Dim ODate Dim OlderBy Dim objFile Dim OToday OToday Date For Each objFile in colFiles strWMIDate objFile.CreationDate ODate WMIDateStringToDatestrWMIDate If WScript.Arguments.Named.ItemOlderBy Then OlderBy CIntWScript.Arguments.Named.ItemOlderBy Else OlderBy 3 End If If OToday - OlderBy ODate Then objFSO.DeleteFileobjFile.Name End If Next End If Function WMIDateStringToDatedtmInstallDate ×??????WMI??????????????????????à????????DateTime??à???? WMIDateStringToDate CDateMiddtmInstallDate 5 2 / _ MiddtmInstallDate 7 2 / LeftdtmInstallDate 4 End Function Sub ShowUsage Dim Str Str FileName: RemoveFilesByDate.vbs VbCrLf _ ????????????±????????????¤??¨??????ì??????????°????????????. VbCrLf VbCrLf _ Version: 1.0 VbCrLf _ Created: icuc88hotmail.com VbCrLf _ Last Modify: Feb 18th 2004 VbCrLf _ All right reserved. VbCrLf VbCrLf _ ???????????? VbCrLf _ Driver:??????????ù????????????????????÷????·?? VbCrLf _ Path:??????????ù??????·???? VbCrLf _ OlderBy:??????????à??????ì??????°??????????????????±????????3??ì???? VbCrLf _ Example: VbCrLf _ 1. ????????3??ì??????°???????????? VbCrLf _ RemoveFilesByDate.wsf /Driver:C: /Path:test VbCrLf VbCrLf _ 2. ????????5??ì??????°???????????? VbCrLf _ RemoveFilesByDate.wsf /Driver:C: /Path:test /OlderBy:5 VbCrLf WScript.Echo Str End Sub °??????????????????????????±??????????????±????????????í????????RemoveFilesByDate.vbs