Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 23rd, 2005, 10:40 PM
Registered User
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to call shell cmd to open exe on clientside?

I have writen javascript which executes shell command to open an exe (say notepad.exe) on the clientside when user clicks on a link in browser.

It gives me "Permission denied" error when i try this.
If it is not Http path , that is if my html file is in the client side only it works fine.

Please suggest me what settings i have to set in the server so that it can execute an exe on the clientside (application like notepad or outlook etc.)

Please suggest.
Thanks in advance.

Old January 24th, 2005, 12:55 AM
Friend of Wrox
Join Date: Dec 2004
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Vadivel Send a message via Yahoo to Vadivel

This would work for IE alone:
<script language="vbscript" >
Function test
   Dim t
   Set t = CreateObject("WScript.Shell")
   t.Run "notepad.exe",1,True
   set t = nothing
End Function

<body onLoad="test"></body>

Best Regards

Old January 24th, 2005, 01:39 AM
Registered User
Join Date: Jan 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

dear Vadivel,
If it is not Http path and run stand alone it works fine.
But when i run it at client server application, it ll give me "automation server can't create object".

Old January 24th, 2005, 05:59 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

There is no server side setting that will allow this, it would be a licence to spread viruses etc. The client must lower security settings for the relevant zone, usually only suitable for "Local Intranet" or "Trusted Sites".


Joe (Microsoft MVP - XML)
Old May 24th, 2006, 05:22 AM
Registered User
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Yeah thats correct
just change ur browser settings, for eg. set ur browser setting to
"Low Level" and then try again ....

Old May 25th, 2006, 02:53 AM
Registered User
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts

I tried doing all the settings still i am getting the error
"ActiveX Componenet cannot create an object"

anyone able to find the solution ???

Old May 25th, 2006, 03:23 AM
Friend of Wrox
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post

Your (IE) browser will need to allow initialization and scripting of ActiveX controls not marked as safe. You can find this in tools -> internet options -> security -> custom level.

Have you got windows scripting host installed on the client machine?



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Shell to invoke cmd script with argument srcLakeJake Access VBA 3 October 26th, 2007 09:35 AM
Shell command or calling VB exe netfresher General .NET 3 October 30th, 2006 06:23 AM
Running cmd line .EXE through PHP geolast PHP How-To 2 January 6th, 2005 02:34 PM
How to integrate vb6.exe into Explorer Shell schurli VB How-To 0 April 3rd, 2004 03:52 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.