【问题标题】:Setting IIS to execute EXE instead of downloading设置 IIS 以执行 EXE 而不是下载
【发布时间】:2020-05-29 17:49:21
【问题描述】:

我正在将 EXE 文件用于内部网站的后端。 我有服务器 2019 和 IIS 10。 当我调用 EXE 文件时,IIS 会尝试下载文件而不是执行它。

我是这样打电话的:

             $.ajax({    
                    url: "cgi-bin/compPack.exe",    
                    dataType: "json",
                    type: "post",       
                    data: dataString,
                    error: ajaxError,           
                    success: function(json){   

这会出错,因为它需要一个 JSON 字符串,如果我输入了

sandbox/cgi-bin/myProgram.exe

在浏览器中它只是下载 EXE。

我添加了 CGI 模块,设置了 CGI-BIN 文件夹的权限,尝试从 Mime 类型中添加和删除 .exe 作为 application/octet-stream 但无法让它运行二进制文件。

我不确定我需要做什么才能使其执行 cgi-bin 文件夹中的(任何)EXE 文件。

【问题讨论】:

  • 我想你的意思是在客户端执行?自动运行 exe 是一种浏览器设置,它非常不安全。您不能从 IIS 端进行配置,否则每个人都会以这种方式传播病毒。
  • 我的意思是我使用的是 EXE 文件而不是 PHP 脚本。 EXE 尝试下载而不是运行。我们有一台带有 IIS 的 2012 服务器整天运行它们,所以我知道它可以完成,但我没有设置。
  • 在 Web 服务器上评估 PHP 脚本并发出 HTML。这就是你的 EXE 所做的吗?
  • 它返回 JSON,不是 HTML,但是是的。
  • EXE 是否响应 GET 请求等?我不是专家,但我相信您必须注册一个自定义处理程序并将所有请求重定向到它。这里有一些链接不太有用,但可能会让您走上正轨。 docs.microsoft.com/en-us/iis/configuration/system.webserver/…stackoverflow.com/questions/44978576/…

标签: iis exe iis-10


【解决方案1】:

解决方法是应用 IBM 演示的 here 设置。 他们的 Watson Explorer Engine 也使用 EXE 作为其 CGI 后端。

IIS 7.0 and higher on Windows 2008 and later systems:
Open IIS Manager:
For Windows 2008 systems: Select Control Panel > Administrative Tools > Internet Information Services (IIS) Manager.
For Windows 2012 systems: From the desktop, hover your cursor in the upper- or lower- right corner of the screen to show the charms. Click the Start charm, and then click the Internet Information Services (IIS) Manager tile.
In the Connections pane, expand the entry for your computer system, expand Sites, and select the default site, which is the site in which the Watson Explorer Engine virtual directory (vivisimo) is created.
Double-click the Handler Mappings feature.
If the state of CGI-exe is Enabled, no additional configuration is necessary. Proceed to Completing the Installation Process (All Platforms).
If the state of CGI-exe is Disabled, select it and click Edit Feature Permissions from the Actions pane. The Edit Feature Permissions window displays.
Select Execute and click OK to enable applications with the .exe extension to execute in response to CGI requests. If Execute is disabled, select Script > Execute, and then click OK.

【讨论】:

    猜你喜欢
    • 2010-10-29
    • 1970-01-01
    • 2011-12-30
    • 2017-12-16
    • 1970-01-01
    • 2017-11-16
    • 1970-01-01
    • 2016-10-28
    • 2017-11-05
    相关资源
    最近更新 更多