简体   繁体   English

从批处理文件安装IIS-获取错误Windows软件包管理器

[英]Install IIS from batch file - get error windows package manager

I try to install the IIS role from a batch file. 我尝试从批处理文件安装IIS角色。

If I call my batch file directly by clicking on it or from the command line, everything works perfectly . 如果我通过单击它或从命令行直接调用批处理文件,则一切正常

But if I call from my program "C #" I see an error window (see below). 但是, 如果我从程序“ C#”中调用,则会看到一个错误窗口 (请参见下文)。

在此处输入图片说明

Here is my code to call my "Batch" file from my "C #" program . 这是从我的“ C#”程序调用我的“批处理”文件的代码。

string path = myPathWork.FullName + "\\install\\installIIS.bat";
System.Diagnostics.Process.Start(path);

Someone you have an idea? 有人有主意吗? I feel that this is due to permissions but I execute the program as well as administrator. 我认为这是由于权限所致,但我同时执行程序和管理员。 Thanks a lot 非常感谢

Here my batchFile for install iis (if i execute this from command line all work fine) : 这是我用于安装iis的batchFile(如果我从命令行执行此操作,则一切正常):

start /w pkgmgr /l:log.etw /iu:IIS-WebServerRole;IIS-WebServer;IIS-CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS-HttpErrors;IIS-HttpRedirect;
IIS-ApplicationDevelopment;IIS-ASPNET;IIS-NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS-ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;
IIS-RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-Security;IIS-BasicAuthentication;IIS-URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS-HttpCompressionStatic;
IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS-ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS-IIS6ManagementCompatibility;
IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS-LegacySnapIn;WAS-WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS-ConfigurationAPI

我没有取消理由,但是我已经从我的批处理文件中删除了这一行,并且一切正常

/l:log.etw

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM