注册Windows service及其相关
注册Windows service,.net写的
net stop "xxxxxx"
"%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe" /u aaaaa.exe
"%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.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:\MyTestCode\RemoteExe\Debug\RemoteExeService.exe"
还不行
最后是少个空格
sc create RemoteExe binpath= "C:\MyTestCode\RemoteExe\Debug\RemoteExeService.exe"
在binpath=之后要有一个空格
真变态