I wrote the install and enable service commands for registering Windows services to the bat executable (named Install.bat), as follows:
%systemroot%\microsoft.net\framework\v4.0.30319\installutil.exe CableAnti.Service.exe
Net Start Checkonlineservice
sc config checkonlineservice start= auto
Then I double-click on this bat file on Windows Server 2008r2, and the cmd command box actually flashed through and never gave a point!
I then right-click Install.bat to run as administrator. I'm scrubbing!!
Was forced to have no way, had to open cmd, switch to Install.bat directory, and put "%systemroot%\microsoft.net\framework\v4.0.30319\installutil.exe CableAnti.Service.exe "Copy to command line,
Enter the run, witness the miracle of the time to come,
Later found a degree Niang several times, I tried the following methods:
(1) Run cmd as Administrator;
(2) The path of CMD is then adjusted to the path where the bat file is located, for example, the path is "D:\Debug".
(3) and then enter "Install.bat" in cmd to install correctly.
Remember it for a later offense!
System.Security.SecurityException exception Resolution for C # Windows Service installation