Running an executable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Id there a way of creating hyperlink that will run a .exe file without acting like a download? If so what is the code for such thing

BoB
 
No.
Running an executable via a browser window isn't
possible for security reasons.

What are you trying to "run"

--
95isalive
This site is best viewed..................
...............................with a computer
BoB said:
Id there a way of creating hyperlink that will run a .exe file without
acting like a download? If so what is the code for such thing?
 
Here's an example

Use this in the <head> </head> block:

<script language = "vbscript">
Sub Router()
set WsShell = createobject("wscript.shell")
set wsx = WsShell.exec("C:\Program Files\Windows NT\hypertrm.exe")
End Sub
</script>

Then in the body, put a button or something that says OnClick="Router()" or
whatever you want to name that sub.

Hope that helps. (you have to tweak your activex security settings for this
code to work, especially, "initialize and script activex controls not marked
as safe", i suggest you set that to be "prompt".

Jace
 
I am creating a link to wjview.exe so a person can view what build of JVM they are running. I just would rather have it execute then to have the person select open. I understand the security reasons behind not allowing exe's to be ran but there must be a way to accomplish what I want to do.

Thanks,
BoB
 
Here's another sample where I send the output to a text area on form1.

<script language = "vbscript">
Sub PingComp()
HostName = document.form1.CompName.value
set WsShell = createobject("wscript.shell")
set wsx = WsShell.exec("ping " & HostName)
document.form1.status.value = trim(wsx.stdout.readall)
document.form1.compname.focus
End Sub
</script>

BoB said:
I am creating a link to wjview.exe so a person can view what build of JVM
they are running. I just would rather have it execute then to have the
person select open. I understand the security reasons behind not allowing
exe's to be ran but there must be a way to accomplish what I want to do.
 
This will run it if your activex settings are right

<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Ping Utility</title>
<script language = "vbscript">
Sub Wjview()
set WsShell = createobject("wscript.shell")
set wsx = WsShell.exec("wjview")
End Sub
</script>
</head>

<body>

<form method="POST" name="form1" action="../IS/--WEBBOT-SELF--">

<p align="left" style="margin-top: 0; margin-bottom: 0"><font size="4">
Wjview</font><font size="4" face="Verdana"> Utility&nbsp;&nbsp;&nbsp;
</font>
<input type="button" value="Run" name="B1" onclick = "Wjview()"></p>

</form>

</body>

</html>

BoB said:
I am creating a link to wjview.exe so a person can view what build of JVM
they are running. I just would rather have it execute then to have the
person select open. I understand the security reasons behind not allowing
exe's to be ran but there must be a way to accomplish what I want to do.
 
Jace,

thanks for your help. I am having one little problem though. To get your script to work I had to do this: set wsx = WsShell.exec("E:\Extras\MSVM\wjview") I would like to get rid of the e:\. is there a way?

Thanks
BoB
 
That's an interesting question. That file should be in %systemroot%\system32
on Windows XP or Windows 2000 I think.

So if you execute this page on a browser that is running win2k or xp, it
should find wjview without a full path statement. What happens if you run it
without the full path?


BoB said:
Jace,

thanks for your help. I am having one little problem though. To get your
script to work I had to do this: set wsx =
WsShell.exec("E:\Extras\MSVM\wjview") I would like to get rid of the e:\.
is there a way?
 
I figured that out after I last posted. I was testing this on a system using Sun's Java. After I placed the .exe in thesystem root it worked fine. And when I run it on my test bed using MSJVM it works. Again thanks for all of your help

BoB
 
Great, no problem.

BoB said:
I figured that out after I last posted. I was testing this on a system
using Sun's Java. After I placed the .exe in thesystem root it worked fine.
And when I run it on my test bed using MSJVM it works. Again thanks for all
of your help.
 
Back
Top