Friday, April 24, 2009

List all drivers (Client Machine)

<HTML>
<HEAD>
<SCRIPT language=JavaScript>

//This function returns the drive list from client system

function getDriveList() {

var objfs, s, n, e, x;

objfs = new ActiveXObject("Scripting.FileSystemObject");

e = new Enumerator(objfs.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 = "<font color=red>[Other Drive-not intialized]</font>";

s += n + "<br>";

e.moveNext();

} while (!e.atEnd());

return (s);

}

</SCRIPT>
</HEAD>
<BODY>
<h5>Available drives on Client system:</h5>
<SCRIPT language=JavaScript> document.write(getDriveList());</SCRIPT>
</BODY>
</HTML>
It Works in IE Only.



No comments:

Creative Commons License
Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.