最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - ShellExecute permission denied in windows - Stack Overflow

programmeradmin1浏览0评论

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
Add a ment  | 

1 Answer 1

Reset to default 6

It's necessary to have two settings turned on.

  1. 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"

  2. 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.

发布评论

评论列表(0)

  1. 暂无评论