本地vbs调试快速显示输出

function setClipBoard(str)
    Set WshShell = CreateObject("WScript.Shell")
    Set oExec = WshShell.Exec("clip")
    Set oIn = oExec.stdIn
    oIn.WriteLine str
    oIn.Close

    Do While oExec.Status = 0
            WScript.Sleep 100
    Loop

    Set oIn = Nothing
    Set oExec = Nothing
end function


dim fso 
dim files
set fso = CreateObject("Scripting.FileSystemObject")
set files = fso.getfolder("C:Data").files

dim result

for each file in files
    if lcase(fso.GetExtensionName(file.path)) = "mdf" then
        result = result & file.name & vbcrlf
    end if
next

setClipBoard(result)

存为*.vbs,双击即可。

原文地址:https://www.cnblogs.com/nanfei/p/3880588.html