WSH 関連情報

VBScript

ファイルのリストを表示するプログラム

  • サンプルコード
    ' 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

添付ファイル: fileFileList.vbs 869件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2021-07-13 (火) 21:52:19 (1017d)