代码如下:
<html>
<голова>
<title> 磁盘管理器 </title>
</head>
<тело>
<div id = "divlist"> </div>
<script language = "vbscript">
Sub List (Spath)
spath = reply (spath, "*", "")
Установить fso = createObject ("scripting.filesystemobject")
SET C_DRIVE = FSO.GetFolder (SPATH)
Установить c_files = c_drive.files
SET C_FOLDER = C_DRIVE.Subfolders
shtml = "<table width = '100%' border = '1' cell -spacing = '0' cellpadding = '0'>"
Для каждого A в c_files
shtml = shtml & "<tr> <td>"
SBPATH = A.Path
shtml = shtml & a.path
shtml = shtml & "<br/> </td> </tr>"
Следующий
shtml = shtml & "</table>"
Document.getElementById ("divlist"). Innerhtml = shtml
Для каждого B в C_FOLDER
shtml = shtml & "<tr> <td>"
SBPATH = B.Path
sbpath = reply (sbpath, "", "*")
sbpath = reply (sbpath, "/", "//")
shtml = shtml & "<a href =# onclick = vbs: list (" "" & sbpath & "" ")>" & b.path & "</a>"
shtml = shtml & "<br/> </td> </tr>"
Следующий
shtml = shtml & "</table>"
Document.getElementById ("divlist"). Innerhtml = shtml
Конец суб
strcomputer = "."
Установить wbemservices = getObject ("winmgmts: //" & strcomputer)
Установить wbemobjectset = wbemservices.execquery ("Выберите имя из win32_perfrawdata_perfdisk_logicaldisk")
Для каждого МО в wbemobjectset
Если instrrev (mo.name, ":", -1, 0)> 0 тогда
document.write "<<input type = butting value =" & mo.name & "onclick = list ('" & mo.name & "/" & ")>"
конец, если
Следующий
</script>
</body>
</html>