BAT file for start and stop commands under Windows

Source: Internet
Author: User

Since the project deployment needs to execute the Xxxx.jar file on the Windows Server, written as bat file, normal we execute the background command start%java_home%\bin\javaw.exe-jar Xxx.jar, is able to start the program, but the process found in the background is javaw.exe, if more than one jar started, we do not know to stop the application, so we need to name the process, we use copy javaw.exe rename way: Copy "%java_home%\ Bin\javaw.exe "%java_home%\bin\xxx.exe" so that we can find the specific process name.

First, start the script Start.bat

@echo Offrem setting JDK path set java_home= "C:\Java\jdk1.7.0_15" rem rename Javaw.exe to the specified name copy "%java_home%\bin\javaw.exe"%java_ Home%\bin\xxx.exe "REM execution jar file with specified name Javaw.exe start" Lock-server "%java_home%\bin\xxx.exe"-jar Xxx.jar

Second, stop the script Stop.bat

Taskkill-f-t-im XXX.exe

BAT file for start and stop commands under Windows

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.