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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Detect drive letter in JavaScript? 1

Status
Not open for further replies.

Ayac

Programmer
Nov 10, 2000
141
HU
Hi!

Do you know if it is possible? I am launching an installation program from a CD that suppose to copy its files to the hard drive C:\
The autorun script launches a web browser to display an html menu and from there to trigger the installation process. Is there a way in JavaScript where I can tell the CD is now in drive D:\ or V:\? or whatever people call it - it could be anything that is my problem, because when I would copy the files, I need the drive letter... a complete UNC path to copy the files properly...
 
How about this?
Code:
var drive = location.href; // say "file:///c:/docs/doc.html
drive.replace("file:\/\/\/",""); // Cut the "file:///"
drive.replace(/\/.*/,""); // Cut the "/docs/doc.html"
Works only with "/" separators.


--Chessbot

"Violence is the last refuge of the incompetent." -- Asimov, Foundation
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top