@echo Offset Filename=e:\winservice\bin\debug\ciwong.account.client.winservice.exeset servicename=accountservice/ /Service Name Pauseecho ============================ operation Log ==================================== >installservice.log if exist "%systemroot%\microsoft.net\framework\v4.0.30319" Goto Netold:disperrorecho the. NET Framework 4.0 is not installed on your machine, the installation is about to terminate Echo The. NET Framework 4.0 is not installed on your machine, installation is about to terminate >>installservice.log Goto LASTEND:NETOLDCD%systemroot%\microsoft.net\ Framework\v4.0.30319echo you have the. NET Framework 4.0 installed on your machine, you can install the service. Echo you have the. NET Framework 4.0 installed on your machine and can install the service >> InstallService.log echo Offecho Cleanup original service items ...%systemroot%\microsoft.net\framework\v4.0.30319\installutil/u% Filename% >> installservice.logecho cleanup echo.echo *********************echo installation service%systemroot%\microsoft.net\ Framework\v4.0.30319\installutil%filename% >> installservice.logecho start service net start%servicename% >> Installservice.logecho *********************echo ======================================================================= >>installservice.logtype InstallService.logecho.echo Operation ended, You can view the specific operation results in the log file InstallService.log. : Lastendpauserem exit
Uninstall:
echo Offset Filename=e:\winservice\bin\debug\ciwong.account.client.winservice.exeset servicename= Accountserviceecho ============================ operation Log ==================================== >UnInstallService.log If exist "%systemroot%\microsoft.net\framework\v4.0.30319" Goto Netold:disperrorecho the. NET Framework 4.0 is not installed on your machine, Uninstall is about to terminate echo your machine does not have the. NET FrameWork 4.0 installed, uninstall the impending termination of >>uninstallservice.log Pausegoto Lastend:netoldecho will uninstall the service ... echo Offpauseecho *********************echo stop Service net stop%servicename% >>UNINSTALLSERVICE.LOGCD%SystemRoot%\ Microsoft.net\framework\v4.0.30319%systemroot%\microsoft.net\framework\v4.0.30319\installutil/uninstall% filename% >>uninstallservice.logecho Uninstall service echo ============================================================= ========== >>uninstallservice.logecho *********************type UnInstallService.logecho.echo operation ended, You can view the specific operation results in the log file UnInstallService.log. : Lastendpauserem exit
Windows service security loading and unloading