C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Find the Drives in System through Javascript.


Posted Date: 09 May 2008    Resource Type: Code Snippets    Category: Html
Author: Chepuri Hariprasad.Member Level: Silver    
Rating: Points: 10




<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>
<SCRIPT language=JavaScript> ShowAvailableDrives(); </SCRIPT>




Responses

Author: Neeraj Saluja    12 May 2008Member Level: Gold   Points : 2
I tried copyint the contents into a simple HTML file and then opening it using IE. It gives the error "Object Expected"
at the line


Any clue, what went wrong ?


Author: Ulfat Hussain    01 Dec 2008Member Level: Silver   Points : 1
To Neeraj!
Please Visit the link below for more JavaScript examples.
you can also see this article there and post your questions at that site for your problem.
http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to convert HTML or XML into XHTML
Previous Resource: Repeatedly showing the backgrounds
Return to Discussion Resource Index
Post New Resource
Category: Html


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use