注册Windows service,.net写的
net stop "xxxxxx"
"%SYSTEMROOT%Microsoft.NETFrameworkv2.0.50727InstallUtil.exe" /u aaaaa.exe
"%SYSTEMROOT%Microsoft.NETFrameworkv2.0.50727InstallUtil.exe" aaaaa.exe
net start "xxxxxx"
xxxxxx是在services管理界面里看到的名字
==============================
c++写的
sc delete xxxx
=================================
今天我用clr写了一个service,试图用InstallUtil.exe注册,自己没有意识到
总是得到这个错误
Exception occurred while initializing the installation:
System.IO.FileLoadException: Attempt to load an unverifiable executable with fixups (IAT with more than 2 sections or a TLS section.) (Exception from HRESULT: 0
x80131019).
后来又用servicename.exe -install
唉
午饭后脑子很不好使
后来用这个
sc create RemoteExe binpath="C:MyTestCodeRemoteExeDebugRemoteExeService.exe"
还不行
最后是少个空格
sc create RemoteExe binpath= "C:MyTestCodeRemoteExeDebugRemoteExeService.exe"
在binpath=之后要有一个空格
真变态