Open Java, jar, py file using bat one click

Source: Internet
Author: User
Tags clear screen

Running the jar directly does not have a command-line window, if you want to have a command-line window, it is generally necessary to win+r run cmd, navigate to the directory, and then use the command line to execute Java-jar Xxx.jar

For Python, opening the py file is also a hassle, by default it loads the source code with idle, and then F5 runs, but there is another way, command line, to locate the directory, Python xxx.py

It's also a problem, but we can do it with a batch of bat.

Create a new TXT, the name is random, open, content copy the following

1 Echo Off :: Turn echo off, that is, the command line does not display return information 2 cd%~dp0:: Navigate to current directory 3CLS:: Clear Screen 4  :: Execute command 5 pause:: Run out of pause , rather than immediately exiting

Explain,

:: Line comment for BAT file

Line four to fill in the command

If the jar is running, then Java-jar Xxx.jar

If it is a py file, then Python xxx.py

can also be used to do a lot of other, digging for themselves

Open Java, jar, py file using bat one click

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.