Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get a drive

Status
Not open for further replies.

spookie

Programmer
May 30, 2001
655
IN
Hi,
I am making an application which contains content in html files which will be bundeled in a CD and will be distributed to the students.
The directory structure of the application is
ModuleName=>
Topic1=>
content1.htm
content2.htm
content3.htm
content3.htm
Topic2=>
content1.htm
content2.htm
content3.htm
content3.htm
Now i want to read the files serially and display the content with a link to next file.
Intially since it will be given in a CD, i was trying to find the name of the CD drive on the user machine using filesystemobject, but still unsucessfull.
Can someone help me in that or some other way to read the file content ?

Thanks in advance.


--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
You would use the driveType property to determine which drive was a CD-Drive:


However, two things to note:

1. If the computer has multile CD (or DVD) drives, they will all show up, so you need to have a better way of detecting which one you are currently using (such as parsing the URL).

2. This will work on IE only.

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]
 
Great, thanks for the answer.
But i need the code to be compatible to NN and Opera also.
Got to do it by some other way..?



--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 

Why do you need to know the drive letter? If you use relative links, you do not need this.

Dan


[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Absolutely..I am finding a way how can i do this using relative path..
right now i am using following code which works on IE..but not sure the this will work on other browsers..pls advice
Code:
<SCRIPT LANGUAGE="JavaScript">
<!--
var fso, f, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder("d:\\path");
fc = new Enumerator(f.files);

for (; !fc.atEnd(); fc.moveNext()) {
	alert(fc.item().name + "\n" + fc.item().type);
}
-->
</SCRIPT>

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top