'================================================================== ' GetDetailsOf メソッドの取得結果を書き出ししますYO! 'http://d.hatena.ne.jp/palm84/ 'http://www10.plala.or.jp/palm84/wsh.html 'http://www10.plala.or.jp/palm84/archives/wsh/GetDetailsOf_Show-SendTo.vbs.txt '================================================================== Option Explicit 'On Error Resume Next If WScript.Arguments.Count = 0 Then MsgBox "コマンドライン引数が指定されてませんクマー (´・ω・`)",48 ,"クマー? (´;ω;`)" WScript.Quit End If ' FileSystemObject オブジェクト作成 Dim objFSO Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") ' Shell オブジェクト作成 Dim objShell Set objShell = WScript.CreateObject("WScript.Shell") ' ログファイル Dim appPath, LogFile Const ForReading = 1, ForWriting = 2, ForAppending = 8 appPath = objFSO.GetParentFolderName(WScript.ScriptFullName) LogFile = appPath & "\GetDetailsOf2.txt" Dim objTxt 'Set objTxt = objFSO.OpenTextFile(LogFile, ForWriting, true, -2) ' Unicode(UTF-16)で出力 Set objTxt = objFSO.OpenTextFile(LogFile, ForWriting, true, -1) Dim strFilePath For Each strFilePath In WScript.Arguments Dim y, strName ' 400 まで回してみるw For y=0 To 500 Dim objFile Set objFile = objFSO.GetFile(strFilePath) Dim strFileName, strFolder ' ファイル名を取得 strFileName = objFSO.GetFileName(strFilePath) ' フォルダ名を取得 strFolder = objFile.ParentFolder ' Shell.Application オブジェクト作成 Dim objShellApp Set objShellApp = CreateObject ("Shell.Application") Dim objFolder, objFolderItems, objItem Set objFolder = objShellApp.Namespace(strFolder) Set objFolderItems = objFolder.Items ' プロパティ情報を objItem に格納 Set objItem = objFolderItems.Item(strFileName) ' プロパティの項目名 strName = objFolder.GetDetailsOf(Nothing, y) 'Call Name_List Call Check_File Next objTxt.WriteBlankLines (2) Next Set objShellApp = Nothing objTxt.Close objShell.Run LogFile Set objTxt = Nothing Set objFSO = Nothing Set objShell = Nothing '********************************************************* ' Sub Name_List '********************************************************* Sub Name_List If strName <> "" Then objTxt.WriteLine y & vbTab & " : " & strName End If End Sub '********************************************************* ' Sub Check_File '********************************************************* Sub Check_File Dim strValue strValue = objFolder.GetDetailsOf(objItem, y) If strValue <> "" Then objTxt.WriteLine y & ") " & strName & vbTab & " : " & strValue End If End Sub