Since this is for windows, there is a much easier way
if you are willing to use MSIE only:
Code:
function findDriveThatIsPlaying( )
{
var drives = "BDEFGHIJKLMNOPQRSTUVWXYZ";
var fso = new ActiveXObject("Scripting.FileSystemObject");
for ( var d = 0; d < drives.length; ++d )
{
var driveletter = drives[d];
if ( fso.FileExists( driveletter + ":\\drive.js" ) )
{
document.cookie="yourdrive="+driveletter+"; path=/";
return driveletter;
}
}
// if you get here, no "drive.js" found on any drive
// what do you want to do???
return null;
}
I think that *HAS* to be *MUCH* faster than trying to get JavaScript to load a file and run it.