Folder.hta [フォルダパス]
<html>
<head><hta:application id="hta"></hta:application>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<title>Folder.hta</title>
<script language=vbscript><!--
Option Explicit
Dim arg
Dim fQuoting
Dim k
fQuoting=False
arg=hta.commandline
For k=1 To Len(arg)
Select Case Mid(arg,k,1)
Case Chr(34) fQuoting=Not fQuoting
Case Chr(32) If Not fQuoting Then Exit For
End Select
Next
arg=Mid(arg,k+1)
arg=Trim(Replace(arg,Chr(34),Empty))
Dim Shell
Set Shell=CreateObject("Shell.Application")
Sub window_onload()
Dim Folder
If arg="" Then
Set Folder=Shell.BrowseForFolder(0,"フォルダ選択",0)
If Not Folder Is Nothing Then Call FileList(Folder.Self.Path,Folder)
Else
Call FileList(arg,Shell.NameSpace(arg))
End If
End Sub
Sub FileList(arg,Folder)
Const M=350
Dim COLS
Dim n
Dim k
Dim FolderItem
Dim script
Dim HTML
Dim charset
COLS=Array("名前","サイズ","更新日時","種類")
For n=0 To UBound(COLS)
For k=0 To M
If Folder.GetDetailsOf(,k)=COLS(n) Then
COLS(n)=k
Exit For
End If
Next
Next
document.open
document.writeln "<html>"
document.writeln "<head>"
document.writeln "<meta http-equiv=""Content-Type"" content=""text/html; charset=Shift_JIS"">"
document.writeln "<meta name=""GENERATOR"" content=""FileList.hta"">"
document.writeln "<title>" & arg & "</title>"
document.writeln "</head>"
document.writeln "<body>"
document.writeln "<table BORDER>"
document.writeln "<caption>" & arg & "</caption>"
document.write "<tr>"
For Each k In COLS
document.write "<td>"
document.write Folder.GetDetailsOf(,k)
document.write "</td>"
Next
document.writeln "</tr>"
For Each FolderItem In Folder.Items
document.write "<tr>"
For Each k In COLS
document.write "<td>"
document.write Replace(Replace(Folder.GetDetailsOf(FolderItem,k),ChrW(8206),""),ChrW(8207),"")
document.write "</td>"
Next
document.writeln "</tr>"
Next
document.writeln "</table>"
document.writeln "</body>"
document.writeln "</html>"
document.close
document.charset="shift_jis"
End Sub
--></script>
</head>
<body>
</body>
</html>
印刷は、(^P)または右クリック「印刷」。
保存は、右クリック「ソースの表示」から「名前を付けて保存」。拡張子は.htmに変える。
フォルダ選択は、(F5)または右クリック「最新の情報に更新」。
起動は、ダブルクリックまたはフォルダをドロップ。
あるいは、sendtoフォルダに入れてフォルダを「送る」。
directoryに関連付けて、フォルダの右クリックで選択。
mshta.exe "パス\Folder.hta" "%1"