I am going to share a code to open any type of desktop application using Internet Explorar (IE) .
If you run this codeinside the browser, it will not work. To resolve this, just save the file with a .hta extension. You will see that the file icon has changed to an application icon. If you double click on this file, it will execute and open a Window having the button inside it. Click the button to open the notepad.exe file.
If you run this code
<html >
<head >
<title >Application Executer</title>
<HTA: APPLICATION ID="oMyApp "
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<script type="text/javascript" language="javascript">
function RunFile ( ) {
WshShell = new ActiveXObject( "WScript. Shell");
WshShell . Run( "c: /windows/system32/notepad.exe", 1, false);
}
</script >
</head >
<body >
<input type="button" value="Run Notepad" onclick="RunFile ( );"/>
</body >
</html >
<
<
<HTA
APPLICATIONNAME="Application Executer"
BORDER="no"
CAPTION="no"
SHOWINTASKBAR="yes"
SINGLEINSTANCE="yes"
SYSMENU="yes"
SCROLL="no"
WINDOWSTATE="normal">
<
}
</
</
<
<
</
</
No comments:
Post a Comment