在阅读了一些其他建议之后,我尝试将我的文件从/ bin文件夹中移出并从另一个位置运行它们,但这也无效.
批处理文件如下所示
@ECHO OFF REM The following directory is for .NET 2.0 set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727 set PATH=%PATH%;%DOTNETFX2% echo Installing IEPPAMS Win Service... echo --------------------------------------------------- InstallUtil /i IEPPAMS_WinService1.exe echo --------------------------------------------------- echo Done.
我有一个安装日志文件,我将信息转储到.如果我只是双击我得到的.bat文件
Running a transacted installation.
Beginning the Install phase of the
installation. See the contents of the
log file for the
C:\Users\Justin\Desktop\service
test\IEPPAMS_WinService1.exe
assembly’s progress. The file is
located at
C:\Users\Justin\Desktop\service
test\IEPPAMS_WinService1.InstallLog.An exception occurred during the
Install phase.
System.InvalidOperationException:
Cannot open Service Control Manager on
computer ‘.’. This operation might
require other privileges. The inner
exception
System.ComponentModel.Win32Exception
was thrown with the following error
message: Access is denied.The Rollback phase of the installation
is beginning. See the contents of the
log file for the
C:\Users\Justin\Desktop\service
test\IEPPAMS_WinService1.exe
assembly’s progress. The file is
located at
C:\Users\Justin\Desktop\service
test\IEPPAMS_WinService1.InstallLog.The Rollback phase completed
successfully.The transacted install has completed.
当我使用管理员权限运行.bat文件时,没有任何内容写入日志文件,并且仍未安装该服务.
有什么想法吗?有没有新的方法在Windows 7中安装服务?
您最有可能与Windows Vista和Windows 7中的新安全模型(用户帐户控制)发生争执.即使您作为具有管理员权限的帐户运行,您仍需要提升以执行某些(大多数)管理活动. (是的,可以禁用此功能,但不能)
> UAC (MSDN)
> UAC (Wikipedia)
> InstallUtil (MSDN)
编辑…正确的命令行是InstallUtil YourApp.exe. / i看起来不是InstallUtil的虚拟交换机.