Can someone tell me why permission is denied to run a shell mand in windows and how to resolve?
function executeCommands(inputparms)
{
var oShell = new ActiveXObject("Shell.Application");
var mandtoRun = "C:\\WINDOWS\\Notepad.exe";
if (inputparms != "")
{
var mandParms = document.Form1.filename.value;
}
oShell.ShellExecute(mandtoRun, mandParms, "", "open", "1");
}
Can someone tell me why permission is denied to run a shell mand in windows and how to resolve?
function executeCommands(inputparms)
{
var oShell = new ActiveXObject("Shell.Application");
var mandtoRun = "C:\\WINDOWS\\Notepad.exe";
if (inputparms != "")
{
var mandParms = document.Form1.filename.value;
}
oShell.ShellExecute(mandtoRun, mandParms, "", "open", "1");
}
Share
Improve this question
asked Oct 30, 2012 at 8:25
SantoshKumarSantoshKumar
2072 gold badges6 silver badges12 bronze badges
3
- Check at this answer: stackoverflow./q/4496681/1776042 – lqs Commented Oct 30, 2012 at 8:34
- 1 @lqs,i did changes to the settings but even after the browser and system restart,changes are not saved(showing "*") – SantoshKumar Commented Oct 30, 2012 at 9:42
- 1 This code will only work with IE. Chrome, Opera, Firefox, ... don't support ActiveXObject. – Khaled Javeed Commented Dec 6, 2013 at 11:04
1 Answer
Reset to default 6It's necessary to have two settings turned on.
- Enable unsigned ActiveX controls for the current zone
Tools > Internet Options > Security > Custom level...
Enable "ActiveX Controls and plug-ins" > "Initialize and script ActiveX controls not marked as safe for scripting"
- Allow Active Content to run files
Tools > Internet Options > Advanced > Security Enable "Allow Active Content to run in files on My Computer"
**** Make sure to close all your IE browser windows.**
Note : as displayed at the bottom of the "Internet Options > Advanced > Security" block, the puter must be restarted for this option to be taken into account.