标签:+= for call UNC statistic file let vbscript list()
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>
标签:+= for call UNC statistic file let vbscript list()
原文地址:https://www.cnblogs.com/k8gege/p/10585720.html