奥运倒计时: 2008 中国挺住,中国加油! 全国人民对四川汶川大地震遇难同胞的深切哀悼! 设为首页 加入收藏
点击进入太平洋安全网首页
论坛登陆 用户名: 密码:
首页 新闻资讯 文章中心 黑客资源 黑客点睛 安全防护 软件下载 动画教程 会员咨询 技术问答 论坛社区
文章 下载 图片
文章   | 电脑知识 | 网络知识 | 菜鸟入门 | 入侵教程 | 黑客攻防 | 黑客编程 | 原创精华 | 黑客人物 | 黑客技术 | 提权技术 | 跨站技术 | 渗透技术 | 鸽子专题 |
 您现在的位置: 太平洋安全网 >> 文章 >> 黑客编程 >> 正文

一个扩展dir命令的vbs脚本

作者:佚名    文章来源:网络转载    点击数:    更新时间:2008-5-13
‘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

文章录入:随风追忆    责任编辑:随风追忆 
  • 上一篇文章:

  • 下一篇文章:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
     推荐文章
    推荐文章一句话木马用Upfile.vbs脚本
    推荐文章软件破解教程-第6章第3节 加密算法5
    推荐文章软件破解教程-第6章第3节 加密算法4
    推荐文章软件破解教程-第6章第3节 加密算法3
    推荐文章Visual C++编程窃取QQ密码(图)
    推荐文章软件破解教程-常用Win32 API函数简介
    推荐文章VB编程实现图像的漂亮效果
    推荐文章输入10进制,输出2进制
     热门文章
    推荐文章软件破解教程-第6章第3节 加密算法3
    推荐文章Visual C++编程窃取QQ密码(图)
    推荐文章VB编程实现图像的漂亮效果
    推荐文章输入10进制,输出2进制
    推荐文章详解Visual C#数据库编程
    推荐文章入侵渗透中用过的三则VBS代码
    推荐文章入侵渗透中用过的三则VBS代码
    推荐文章网站防止注入入侵的一些有效代码和方法
     本站推荐

    关于我们 | 联系方法 | 招聘信息 | 加入会员 | 诚征代理 | 广告服务 | 欢迎投稿 | 站长信箱 | 友情链接 | 网站地图
    24小时客服:0374-7126138 技术支持:0374-7126138 投诉电话:0374-7967536
    客服QQ:883039 售后QQ:827520 技术QQ:78305152 投稿-商业:576880739
    Copyright 太平洋科技 2003-2007 版权所有 All Rights Reserved
    许可证号:豫ICP备07005385号