Detecting existing file with VBscript and HTML Document.write
I am doing something wrong, but I think it's possible. It's about detecting EWH32.API from adobe so I can detect the webbrowser plugin.
Code
-----
function detectEWH32(DriveID,name) {
//
// By Peter Boons - Belgium
// ------------------------
// C:\Program Files\Adobe\Acrobat 6.0\Reader\plug_ins ------ // C:\Program Files\Adobe\Acrobat 7.0\Reader\plug_ins ------ Test 16 July 2005 Virtual PC Mac Windows 2000 SP4 Rollup 1
//
// Detect vanaf Version 6.0 betekent dat PDF geopend wordt in Browser window bij Internet Explorer.
//
result = false;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('dim filesys\n');
document.write('Set filesys = CreateObject("Scripting.FileSystemObject")\n');
document.write('If filesys.FileExists("' + DriveID + ':\\Program Files\\Adobe\\Acrobat 7.0\\Reader\\plug_ins\\ewh32.api") then result=true\n');
document.write('</script\>\n');
if (result) return name+','; else return '';
}
I think my problems has todo with the '\'-backslash ...
Can somebody help
Peter
I am doing something wrong, but I think it's possible. It's about detecting EWH32.API from adobe so I can detect the webbrowser plugin.
Code
-----
function detectEWH32(DriveID,name) {
//
// By Peter Boons - Belgium
// ------------------------
// C:\Program Files\Adobe\Acrobat 6.0\Reader\plug_ins ------ // C:\Program Files\Adobe\Acrobat 7.0\Reader\plug_ins ------ Test 16 July 2005 Virtual PC Mac Windows 2000 SP4 Rollup 1
//
// Detect vanaf Version 6.0 betekent dat PDF geopend wordt in Browser window bij Internet Explorer.
//
result = false;
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('dim filesys\n');
document.write('Set filesys = CreateObject("Scripting.FileSystemObject")\n');
document.write('If filesys.FileExists("' + DriveID + ':\\Program Files\\Adobe\\Acrobat 7.0\\Reader\\plug_ins\\ewh32.api") then result=true\n');
document.write('</script\>\n');
if (result) return name+','; else return '';
}
I think my problems has todo with the '\'-backslash ...
Can somebody help
Peter