首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >批处理文件在服务器上不工作,但在本地工作

批处理文件在服务器上不工作,但在本地工作
EN

Stack Overflow用户
提问于 2014-11-20 13:26:04
回答 1查看 1.3K关注 0票数 3

我在我的asp.net网站上创建了一个批处理文件,它在本地系统中工作没有任何问题。在我将其上传到网站的服务器(共享服务器)后,它在远程环境中无法工作。

下面是我收到的错误的屏幕截图

这是我用来在服务器上测试运行批处理的代码。

代码语言:javascript
复制
    string path = Server.MapPath("~/SourceCode/Jsil");
    Response.Write(path+"<br>");
    string batpath=Server.MapPath("~/Dir.bat");
    string framework = Server.MapPath("~/SourceCode/v4.0.30319");
    string vscompiler = @"\csc.exe /t:exe /r:JSIL.dll;JSIL.Meta.dll Program.cs";
    string full = framework + vscompiler;
    Response.Write(full);
    StreamWriter file = new StreamWriter(batpath);
    file.WriteLine("G:");
    file.WriteLine("cd " + path);
    file.Write(full);
    file.Close();
    //Excecute bat file
    System.Diagnostics.Process compile = new System.Diagnostics.Process();
    compile.StartInfo = new ProcessStartInfo(batpath);
    compile.Start();
    compile.Close();
EN

回答 1

Stack Overflow用户

发布于 2015-01-08 15:00:52

这可能是一个简单的权限问题。应用程序用户可能在服务器框中没有execute权限。您需要与系统管理员联系,并要求他为服务器中的IIS应用程序池用户提供执行权限。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27032371

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档