Windows service safety loading and unloading

Source: Internet
Author: User

@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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.