Play with JavaScript : Get Details of Client Drive list

The following Code snippet talks about How to obtain listing of Client System's Drive
  1. <HTML>    
  2. <HEAD>    
  3.     
  4. <SCRIPT language=JavaScript>    
  5.         
  6.     //Following function returns the drive list from client system    
  7.     function getClientDrives() {    
  8.         var objfs, s, n, e, x;    
  9.         objfs = new ActiveXObject("Scripting.FileSystemObject");    
  10.         e = new Enumerator(objfs.Drives);    
  11.         s = "";    
  12.         do {    
  13.             x = e.item();    
  14.             s = s + x.DriveLetter;    
  15.             s += ":    ";    
  16.             if (x.DriveType == 3) n = x.ShareName;    
  17.             else if (x.IsReady) n = x.VolumeName;                
  18.             else n = "<font color=red>[Other Drive-not intialized]</font>";    
  19.             s += n + "<br>";    
  20.             e.moveNext();    
  21.         } while (!e.atEnd());    
  22.     
  23.         return (s);    
  24.     }        
  25.     
  26. </SCRIPT>    
  27. </HEAD>    
  28.     
  29. <BODY>    
  30. <P>    
  31. <h1>The following is the list of available drives on Client system:</h1>    
  32. <SCRIPT language=JavaScript>    document.write(getClientDrives());</SCRIPT>    
  33. </P>    
  34. </BODY>    
  35. </HTML>    
Create a new file with above code and run on a browser.