Friday, May 17, 2024
137
rated 0 times [  139] [ 2]  / answers: 1 / hits: 109504  / 14 Years ago, thu, november 11, 2010, 12:00:00

I have a very simple javascript code,



<script language=javascript>          
function RunExe()
{
w = new ActiveXObject(WScript.Shell);
w.run('notepad.exe');
return true;

}
</script>
<form id=form1>
<div>
<input type=button value=Run onclick=return RunExe() />
</div>
</form>


Which create an activeX object to run notepad.exe, if I save this in a plain html and run it in the IE, it works fine opening up the notepad, but if I insert this into a aspx page and run it, it will give an error called Automation server can't create object, I googled it many times, but the IE security things I have already done and I think it's something in ASP or IIS which I couldn't figure out.



Your suggestions and inputs are highly appreciable.



Thanx


More From » internet-explorer

 Answers
10

Well you can not run code from notepad so that means you are opening up the page from the file system. aka c:/foo/bar/hello.html



When you run the code from the asp.net page, you are running it from localhost. aka http://loalhost:1234/assdf.html



Each of these run in different security zones on IE.


[#95007] Tuesday, November 9, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
devinjadong

Total Points: 711
Total Questions: 117
Total Answers: 100

Location: Andorra
Member since Sat, May 27, 2023
1 Year ago
devinjadong questions
Thu, Feb 17, 22, 00:00, 2 Years ago
Wed, Dec 8, 21, 00:00, 2 Years ago
Tue, Oct 27, 20, 00:00, 4 Years ago
Fri, Oct 18, 19, 00:00, 5 Years ago
;