hypervox

Finding your actual path / drive letter from VBScript or JavaScript.

I've noticed on newsgroups that web developers sometimes need to place the creations on CD. I had an occasion to recently, as well as access a database ON that CD.

Easy right? NOPE!!!

Because scripts run in a "sandbox" environment, you can't get the browser to use the file system, and relative links don't work when accessing DB's. The answer (for me at least) was to pull the drive letter & path from the URL of the page (if you run a web page from disk, the drive letter is usually included).

Below are the scripts I developed, in VBScript & Javascript versions. If you can make use of them, feel free, but let me know if you have any problems or comments.

VBScript

JavaScript