windows use xxx.bat related to the operation command

Think of the phrase today: the adult world, please stop low-level busy 

 

Generally need to perform some commands supported on the windows, we usually use the console to operate directly, for instruction requires frequent operations, the use of the console slightly inconvenient, such as accidentally turned off the console, but also repeat some paths operate, then we can use the .bat batch to solve this problem, which is to execute the command written in the .bat file, click the bat file after each run just fine, for some complex command, you can greatly facilitate our operations. The following simple example to run a jar:

cd Desktop

@echo "============== 开始 =============="

java -Dloader.path="C:\Users\hspcadmin\Desktop\lib_one" -jar mytest.jar

pause

Including the role of pause is to retain the console, or after the execution of the console will disappear, save for the above-mentioned documents mtest.bat, click Run:

Console inside the Chinese garbled, and only need to change the file encoded as ANSI encoding (use notepad ++ -> Encoding -> into ANSI encoding), as shown below:

After re-setting Chinese content, re-run mtest.bat

You can see the Chinese normally show

 

Guess you like

Origin www.cnblogs.com/kingsonfu/p/11868705.html