从网页上执行服务器上的批处理文件 [英] execute batch file on server from web page

查看:159
本文介绍了从网页上执行服务器上的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,



我有一个批处理文件,我想在asp.net的webapplication开发人员的服务器上执行



但是当我使用下面的代码来运行批处理文件时,我得到访问被拒绝错误。

Hello,

I have a batch file which I want to execute on the server from webapplication developer in asp.net

But when I use below code to run the batch file, I get access denied error.

ProcessStartInfo psi = new ProcessStartInfo();
        psi.FileName = Server.MapPath(ConfigurationManager.AppSettings["Path"]) + "TestingApplication.bat";
       

        Process proc = new Process();
        proc.StartInfo = psi;
        proc.Start();



批处理文件放在应用程序的bin文件夹中。



我的Web应用程序正在使用表单身份验证。

我需要知道如何为执行此批处理文件提供预备。


Batch file is placed in the bin folder of the application.

My web application is using forms authentication.
I need to know how to provide premissions for execution of this batch file.

推荐答案

Web应用程序进程的运行安全级别低于用户,因此您必须确保您的Web进程可以访问批处理文件以及该文件在该文件中的操作。



http://www.iis.net/learn/manage/configuring-security/application -pool-identity [ ^ ]



指南解决IIS权限问题 [ ^ ]
Web app processes run at a lower security level than users so you must make sure your web process has access to the batch file and what it is doing within that file.

http://www.iis.net/learn/manage/configuring-security/application-pool-identities[^]

Guidelines for Resolving IIS Permissions Problems[^]


这篇关于从网页上执行服务器上的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆