文章 | 入侵攻击 | 安全防御 | 操作系统 | 建站技术 | 脚本编程 | 路由交换 | 灾难恢复 | 新闻资讯 | 安全公告   
下载 | 漏洞扫描 | 加密破解 | 入侵攻击 | 后门木马 | 溢出程序 | 综合工具 | 安全防护 | 原创发布 | 动画教程 
论坛 | 配服务器 | 黑客情感 | 免费资源 | 爆笑贴图 | 灌水无罪 | 会员照片 | 在线服务 | 站长博客 | 网站首页 
 您现在的位置: 华夏黑客联盟 >> 攻防技术 >> 脚本编程 >> 文章正文  

一个扩展dir命令的vbs脚本

www.hxhack.com 阅读: 时间:2008-5-12 7:55:06 整理:华夏黑盟
------------------------------------------------------------------

 一个扩展dir命令的vbs脚本
‘CMD下的dir好像没法列出从某段时间到某段时间的文件,所以写了这个小东东

set Arg=Wscript.Arguments
If Arg.Count=0 then
Wscript.echo chr(9)&chr(9)&space(4)&”Xdir v0.1″
Wscript.echo “”
Wscript.echo chr(9)&”cscript dir.vbs path time1 time2 ext”
Wscript.echo chr(9)&”cscript dir.vbs d:\test 20080101 20080430 doc”
Wscript.Quit
End If
Path=Arg(0)
Time1=Arg(1)
Time2=Arg(2)
Ext=Arg(3)
FileTotal = 0
DirTotal = 0
FileTotalsize=0
TimeSpend = Timer
myFind Path
TimeSpend = round(Timer - TimeSpend,2)
txtResult = “搜索完成!” & vbCrLf & “共找到文件:” & FileTotal & “个.” & vbCrLf & “共搜索目录:” & DirTotal & “个.” &vbcrlf&”文件总数大小”&FormatNumber(FileTotalsize/1024,0)&”kB”& vbCrLf & “用时:” & TimeSpend & “秒.”

wscript.echo txtResult

Sub myFind(ByVal thePath)

Dim fso, myFolder, myFile, curFolder
Set fso = wscript.CreateObject(”scripting.filesystemobject”)
Set curFolders = fso.getfolder(thePath)
DirTotal = DirTotal + 1
If curFolders.Files.Count > 0 Then
For Each myFile In curFolders.Files
If InStr(1, LCase(Fso.GetExtensionName(myFile.Name)), ext) > 0 And Gtime(myFile.DateCreated) >Time1 And Gtime(myFile.DateCreated)<Time2 Then
wscript.echo FormatPath(thePath) & “\” & myFile.Name
FileTotal = FileTotal + 1
FileTotalsize = FileTotalsize + myFile.size
End If
Next
End If

If curFolders.subfolders.Count > 0 Then
For Each myFolder In curFolders.subfolders
myFind FormatPath(thePath) & “\” & myFolder.Name
Next
End If

End Sub

Function FormatPath(ByVal thePath)

thePath = Trim(thePath)
FormatPath = thePath
If Right(thePath, 1) = “\” Then FormatPath = Mid(thePath, 1, Len(thePath) - 1)

End Function

Function Gtime(str)
str=FormatDateTime(str,2)
str1=Split(str,”-”,-1,1)
If len(str1(1))=1 then str11=”0″&str1(1)
If len(str1(2))=1 then str12=”0″&str1(2)
Gtime=str1(0)&str11&str12
End Function 

 

   -------------------------------------------------------------------------------------------
  • 上一篇文章:

  • 下一篇文章:
  •    -------------------------------------------------------------------------------------------
    用户名:
    Email:
    评论内容:
     
      精品推荐

     十招教你学会破解(学黑客
     C语言与C++有什么区别吗
     VB病毒编写——初学编程
     世界编程大赛第一名写的
     木马是如何编写的
     绝版破解软件教程就不信
     如何编写木马病毒
     隐藏cmd命令行运行
     学ASP只需一小时!
     如何提高自己的编程能力
     初学者天地--用C语言写的
     四个经典的vbs脚本整理
     Visual C++编程窃取QQ密
     怎样学好编程C语言
     跟我学做记事本
     编程语言初步知识(供菜
     一个程序员写的求爱程序
     阿拉QQ大盗盗号原理分析
     什么是vb,vb是什么意思
     成为编程高手的二十二条
     看黑客编写强力蓝屏炸弹
     C语言基础教程合集(整理
     学C++时要注意的
     C语言之精华总结
     [VB]猎取当前QQ聊天内容


    设为首页 | 软件发布 | 联系方式 | 友情链接 | 关于我们 | 本站声明 | 免责条款 | 网站留言
    Copyright © 2004-2007 Www.Hxhack.Com
    版本:华夏黑客联盟 Email:hxhack.com@163.com
    中国·广东 请使用IE6.0版本, 分辩率1024×768进行浏览
    版权所有 任意抄袭 注意完整
    粤ICP备06123842号