<HTML><HEAD>
<TITLE>List Local Drives</TITLE>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript" SRC="">
function list() {
	var nobj, result, n, e, x;
	result = "";
	nobj = new ActiveXObject("Scripting.FileSystemObject");
	e = new Enumerator(nobj.Drives);
	for (; !e.atEnd(); e.moveNext()) {
		x = e.item();
		result = ''+result + x.DriveLetter+'';
		result += " - ";
		if (x.DriveType == 3) n = x.ShareName;
		else if (x.IsReady)
		n = x.VolumeName;
	else n = "(Not ready)"; result += n + "<BR>";
  }
  return(result);
}
</SCRIPT>
</HEAD><BODY>
<A href="javascript:list()">List local drives</A>
Published in: ActiveX
Download

Related snippets