Launching an exe from html

G

Guest

I am creating a web site that will be ran by cd rom locally. I want to be able to launch exe's, that reside on the cd, from an HTML file without the save as dialog box. I included the script I am using but it requires full path name and depending on the system the drive letter will change. So is there a way to launch a exe, that resides on the same cd as the html file

Thanks,JO

<html><Head><script language = "vbscript"
Sub Router(
set WsShell = createobject("wscript.shell"
set wsx = WsShell.exec("[drive letter]:\<folder name>\*.exe"
End Su
</script></head><body><form><input type="Button" value="Click Here" onclick="Router()"></form>
 
J

Jim Buyens

I would think that simply omitting the drive letter would
default to the drive that loaded the script.

If not, WScript.ScriptFullName returns the full
name of the currently running script. So,

Left(WScript.ScriptFullName, 1)

would return the drive letter. So,

set WsShell = createobject("wscript.shell")
drv = Left(WScript.ScriptFullName, 1)
set wsx = WsShell.exec(drv & ":\<folder name>\*.exe")

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*========----------
|\=========------------
|| Microsoft Office FrontPage 2003 Inside Out
|| Microsoft FrontPage Version 2002 Inside Out
|| Web Database Development Step by Step .NET Edition
|| Troubleshooting Microsoft FrontPage 2002
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/=========------------
*========----------

-----Original Message-----
I am creating a web site that will be ran by cd rom
locally. I want to be able to launch exe's, that reside
on the cd, from an HTML file without the save as dialog
box. I included the script I am using but it requires
full path name and depending on the system the drive
letter will change. So is there a way to launch a exe,
that resides on the same cd as the html file?

Thanks,JOE

<html><Head><script language = "vbscript">
Sub Router()
set WsShell = createobject("wscript.shell")
set wsx = WsShell.exec("[drive letter]:\<folder name>\*.exe")
End Sub
</script></head><body><form><input type="Button"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top