futrueface

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理


Dim picPath
picPath="d:\pictrue\"
Set fso=CreateObject("scripting.filesystemobject")
Set files=fso.GetFolder(picpath).Files
ForEach file In files
    IfInStr(file.Type,"图像") Then
        filenamestr=file.ShortName & "," & filenamestr
    EndIf
Next
strArray= Split(filenamestr,",")

j=0:i=1
Set WshShell = WScript.CreateObject("WScript.Shell")

Do
    WshShell.Run picPath & strArray(i-1)
    WScript.Sleep  3000
    wshshell.Run "taskkill /f /im dllhost.exe"
    WScript.Sleep 700
    j=j+1
    i=i+1
    If  j = UBound(strArray)+1Then
        j=0:i=1
        Do
            s= MsgBox ("浏览完毕是否重新浏览", 3, "图片自动浏览")'6-->是,7-->否,2-->取消和关闭
            If s = 6Then
                ExitDo
            Else
                WScript.Quit
            EndIf
        Loop
    EndIf
Loop

posted on 2015-01-13 23:21  futrueface  阅读(293)  评论(0编辑  收藏  举报