how to find list of drives in local pc in php

i want to find list of drives in local pc like c: ot d:, if anyone can

Page 1 of 1

0 Replies - 3073 Views - Last Post: 18 January 2008 - 02:40 AM Rate Topic: -----

#1 swetapatel   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 17-January 08

how to find list of drives in local pc in php

Post icon  Posted 18 January 2008 - 02:40 AM

i want to find list of drives in local pc like c: ot d:, if anyone can know function for that php or javascript.

i have tried this javascript cod

<HTML>
<HEAD>

<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 + "<br>";
e.moveNext();
} while (!e.atEnd());

return(s);
}

</SCRIPT>
</HEAD>

<BODY>
<P>
<script language=Javascript> ShowAvailableDrives(); </SCRIPT>
</P>
</BODY>
</HTML>

but it says that automation server can't create object in IE and in firefox it's not working. please tell me if you have any solutions.

Is This A Good Question/Topic? 0
  • +

Page 1 of 1