[源码]VBS和JS列出所有驱动器
Posted k8gege
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[源码]VBS和JS列出所有驱动器相关的知识,希望对你有一定的参考价值。
VBS和JS列出所有驱动器[K8team] 2011-07-11 20:20:32| 分类: 脚本编程 | 标签:vbs列驱动器 js列驱动器 脚本编程 k8team <script language="vbscript"> Sub ShowDriveList() Dim fs, d, dc, s, n Set fs = CreateObject("Scripting.FileSystemObject") Set dc = fs.Drives For Each d In dc If d.isready Then s = s & d.DriveLetter & " - " If d.DriveType = 3 Then n = d.ShareName Else n = d.VolumeName End If s = s & n & "<br>" End If Next document.write(s) End Sub call ShowDriveList </script> <--document.write(s) MsgBox s vbCrLf--> <script> function ShowDriveList() { var partion=null; var statistics=‘‘; var fso =new ActiveXObject("Scripting.FileSystemObject"); var e = new Enumerator(fso.Drives); var s = ""; for (; !e.atEnd(); e.moveNext()) { x = e.item(); s = s + x.DriveLetter; s += " - "; if (x.DriveType == 3) n = x.ShareName; else if (x.IsReady) n = x.VolumeName; else n = "[驱动器未就绪]"; s += n + "<br>"; } document.write(s); } ShowDriveList(); </script>
以上是关于[源码]VBS和JS列出所有驱动器的主要内容,如果未能解决你的问题,请参考以下文章