#contents

*WSH 関連情報
**VBScript
***ファイルのリストを表示するプログラム
-サンプルコード
#ref(FileList.vbs);
 ' FileList.vbs
 ' Usage : CScript //NoLogo FileList.vbs
 Dim fso
 Set fso = CreateObject("Scripting.FileSystemObject")
 Dim folder
 Set folder = fso.GetFolder(".")
 
 Dim subFolder
 For Each subFolder In folder.SubFolders
    WScript.Echo _
    subFolder.DateCreated & " " & _
    subFolder.DateLastModified & " " & _
    subFolder.DateLastAccessed & " " & _
    "<DIR> " & subFolder.Name
 Next
 Dim file
 For Each file In folder.Files
    WScript.Echo _
    file.DateCreated & " " & _
    file.DateLastModified & " " & _
    file.DateLastAccessed & " " & _
    file.Name
 Next
-実行結果
 D:\home\edu\VBScript\FileList>CScript //NoLogo FileList.vbs
 2004/06/08 17:28:03 2004/06/08 17:28:03 2004/06/08 17:28:03 <DIR> aaa
 2004/06/08 17:28:06 2004/06/08 17:28:06 2004/06/08 17:28:06 <DIR> bbb
 2004/06/08 17:39:47 2004/06/08 17:39:40 2004/06/08 17:39:47 FileList.vbs
 2004/06/08 17:23:07 2004/06/08 17:23:07 2004/06/08 17:23:07 test.tt
 2004/06/08 17:21:12 2004/06/08 17:39:40 2004/06/08 17:39:40 test.vbs

-はてな
--http://www.hatena.ne.jp/1086680518

-関連情報
--http://www.hondarer-soft.com/cx/pukiwiki/pukiwiki.php?Memo%2F2004-06-09

#comment

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS