Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run an .exe file using ASP code 1

Status
Not open for further replies.

Gragi

Programmer
Oct 4, 2004
59
US
Hi,
I am trying to search for some DLLs at the local system, if those DLLs are not available then
it should execute the .EXE file which is in the server. I was able to do till searching DLLs, but
afterwards how to make that executable run.

I am expecting something like, when you try to open some webpages it asks to install ActiveXControls
and displays a windows and with Run button. So Iam expecting that kind of output. Even if it is not that
fancy, if it is just able to display it's installing that EXE file is also fine for me.

Thank You Very much,
Gragi
 
I would give Sheco a star for all that typing, he is great in explaining things.

I guess I didn't understand the problem fully. ASPExec is not what you are looking for.

Good luck.
 
What Sheco says is seem correct to me to. Then I can go with the Wscript.shell code and is working for me too.

Set WshShell = Wscript.CreateObject ("Wscript.Shell")
WshShell.Run " 1, false

The only issue I have is it's displaying OPEN/SAVE/Cancel window twice. Is there any way that we can avoid this Or is it not avoidable?

Thank You,
Gargi
 
Did you try using something other than 1 as the second parameter?
 
Gragi, I know you are going with the WshShell script, but looking at you previous post on 24 Jan 06 17:28,
change the lines from
Executor.Parameters = strString
Executor.ShowWindow = False
To
'Executor.Parameters = ""
Executor.ShowWindow = True

In case you want to try and get this working.
ksbigfoot
 
I tried with the other parameters too, still the same. The message window doesn't bother me much I'm just concerned about the client.

ksbigfoot,
Even trying after changing the ShwWindow to TRUE it still the same, for instance if we think it's running but not showing up then it should be visible in the Task Manager right? but it's not.
I don't mind trying in different ways, my goal is to get the result.

Thank You so much for everyone who helped me in this query,

I will keep checking this query for the result, but for time being I will go with the one is working.

Thanks again,
Gragi
 
Also don't forget to check out MSI if you are trying to install something.
 
Howdy Gragi,
This code below worked for me for running an .exe file.
But, it pops up the calc on the server that is hosting the website, which I don't think you are asking for. My application just needs to run the .exe file and the user doesn't need to see it. So what I am doing is different than what I think you need.
One other area I think needs to be set is in the Services.
Go into the Services - World Wide Web Publishing service and go to the log on tab,
On the radio button of log on as: Local account, check the box to Allow Service to Interact with desktop.

Code:
<% Response.CacheControl = "no-cache" %>>
<% Response.AddHeader "Pragma", "no-cache" %> 
<% Response.Expires = -1 %>
<html>
<head>
  <title>Run exe file</title>
</head>
<body>
<%
Dim Executor
Dim strResult
    Set Executor = Server.CreateObject("ASPExec.Execute")
    Executor.Application = "C:\WINNT\system32\Calc.exe"
	
    Executor.Parameters = ""
    Executor.ShowWindow = True
    Executor.TimeOut = 120 
    strResult = Executor.ExecuteWinApp
%>
Ok, check this out<br>
</body>
</html>
 
ksbigfoot,

Thank for the code, I have tried this.
First of all this is running behind I mean it is running but not visible,
then I was not able to kill this process even after closing all the windows also, unless I reboot my system I was not able to terminate this process.
I don't think it's correct solution for my issue, but this code will be helpful if I want to run anything behind.

Thanks Again,
Gragi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top