Link to home
Start Free TrialLog in
Avatar of edsrajesh
edsrajesh

asked on

invoking the exe on click of submit button

i want to invoke the .exe application on click of the submit button.
i am adding the below code in my java script code,

 var tempFile = "sample.exe"
 var WshShell = new ActiveXObject("WScript.Shell");
 WshShell.Run(tempFile);

the exe is getting invoked but the html file is opening before
running the exe. how can i avoid the opening of the html file.
Avatar of Davee
Davee

One of the possible way to delay the opening of the html is by using a intentional loop which make ur execution delayed a bit.

a sample code for incoorporating delay functionality.
HTML>
<head>
<script>
<!--
function wait(delay){
string="pauseforalert("+delay+");";
setTimeout(string,delay);
}
function pauseforalert(delay){
alert("Ok "+delay/1000+" seconds have elapsed");
}
// -->
</script>
</HEAD>
<BODY>
<a href="javascript:void()" onClick="wait(1000);">click here and wait 1 sec</a><BR>
or<BR>
<a href="javascript:wait(2000)">click here and wait 2 secs</a><BR>

</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
Avatar of Zvonko
Zvonko
Flag of North Macedonia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp


Cd&

It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to Zvonko

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

Thanks Cd& and Mod.