I get "Permission Denied" error code when execute the following script from
HTML page.
The error happened on ShellExecute call.
I have tried it on Win 2000 PRO, WIn XP Home SP2 with the latest version of
IE and SPacks.

What is the problem??
The test file c:/aaa.txt is OK and I have administrator account

<P><INPUT type=button value="test button" id=button4 name=button4></P>

<SCRIPT LANGUAGE="VBScript">

<!--

Sub button4_onclick()

Dim eShell

Set eShell = CreateObject("Shell.Application")

eShell.ShellExecute "c:/aaa.txt", "", "", "open", 1

End Sub

-->

</SCRIPT>

Re: ShellExecute - permission denied by Michael

Michael
Tue Sep 13 23:21:08 CDT 2005

Anastasia Gryaznov wrote:
> I get "Permission Denied" error code when execute the following
> script from HTML page.
> The error happened on ShellExecute call.


Certain methods of the Shell.Application object are not safe for scripting
from client side script in the browser...


> I have tried it on Win 2000 PRO, WIn XP Home SP2 with the latest
> version of IE and SPacks.
>
> What is the problem??
> The test file c:/aaa.txt is OK and I have administrator account
>
> <P><INPUT type=button value="test button" id=button4 name=button4></P>
>
> <SCRIPT LANGUAGE="VBScript">
>
> <!--
>
> Sub button4_onclick()
>
> Dim eShell
>
> Set eShell = CreateObject("Shell.Application")
>
> eShell.ShellExecute "c:/aaa.txt", "", "", "open", 1
>
> End Sub
>
> -->
>
> </SCRIPT>

--
Michael Harris
Microsoft MVP Scripting





Re: ShellExecute - permission denied by Mikhail

Mikhail
Wed Sep 14 12:53:54 CDT 2005

Is there any way to allow this ShellExecute command from the HTML page?

"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:ubv0AQOuFHA.2392@tk2msftngp13.phx.gbl...
> Anastasia Gryaznov wrote:
>> I get "Permission Denied" error code when execute the following
>> script from HTML page.
>> The error happened on ShellExecute call.
>
>
> Certain methods of the Shell.Application object are not safe for scripting
> from client side script in the browser...
>
>
>> I have tried it on Win 2000 PRO, WIn XP Home SP2 with the latest
>> version of IE and SPacks.
>>
>> What is the problem??
>> The test file c:/aaa.txt is OK and I have administrator account
>>
>> <P><INPUT type=button value="test button" id=button4 name=button4></P>
>>
>> <SCRIPT LANGUAGE="VBScript">
>>
>> <!--
>>
>> Sub button4_onclick()
>>
>> Dim eShell
>>
>> Set eShell = CreateObject("Shell.Application")
>>
>> eShell.ShellExecute "c:/aaa.txt", "", "", "open", 1
>>
>> End Sub
>>
>> -->
>>
>> </SCRIPT>
>
> --
> Michael Harris
> Microsoft MVP Scripting
>
>
>
>



Re: ShellExecute - permission denied by Michael

Michael
Wed Sep 14 23:48:30 CDT 2005

Mikhail Gryaznov wrote:
> Is there any way to allow this ShellExecute command from the HTML
> page?

You could customize the security zone settings to allow it though that opens
a security exposure and is certainly *not* recommended.

For an inTRAnet scenario, you could deploy an HTA rather than a conventional
browser hosted web page.

deploy hybrid hta group:*.scripting author:"Michael Harris" - Google Groups
http://groups.google.com/groups?q=deploy%20hybrid%20hta%20group:*.scripting%20author:"Michael%20Harris"

--
Michael Harris
Microsoft MVP Scripting