Live Chat Icon For mobile
Live Chat Icon

How can you identify the drives available in the System?

Platform: ASP.NET| Category: Client Side Scripting

The drives available in system can be identified using the following code.

	<SCRIPT language=JavaScript> 
function ShowAvailableDrives() { document.write(GetDriveList()); } function GetDriveList() { var fso, s, n, e, x; fso = new ActiveXObject('Scripting.FileSystemObject'); e = new Enumerator(fso.Drives); s = ''; do { x = e.item(); s = s + x.DriveLetter; s += ':- '; if (x.DriveType == 3) n = x.ShareName; else if (x.IsReady) n = x.VolumeName; else n = '[Drive not ready]'; s += n + ' '; e.moveNext(); }while (!e.atEnd()); return(s); } </SCRIPT> </HEAD> <BODY> <P> <SCRIPT language=JavaScript> ShowAvailableDrives(); </P> </BODY> </HTML>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.