Dos Write a simple script + garbled problem

Source: Internet
Author: User

Project structure

Project Name--|--classes

|--lib

|--startup.bat

@echo off
:: Several parameters that need to be modified
Set Arg0=xxx
Set Arg1=xxx
Set Arg2=xxx
Set Dir=xxx
:: Modify DOS code to UTF-8
Chcp 65001
Set java_home=c:\java\jdk1.7.0_67\
Set classpath=.;
For%%c in (Lib\*.jar) do set classpath=!classpath!; %%c
Set classpath=%classpath%;. /classes;%java_home%\jre\lib\rt.jar;%java_home%\lib\dt.jar;%java_home% \lib\tools.jar
Set _java_options= "-dfile.encoding=utf-8"
Java%_java_options%-djava.ext.dirs=%dir%/lib-cp%classpath% com.asiainfo.biframe.test.Test%arg0%%arg1%%arg2%
Pause

My garbled problem solved:

DOS scripts, DOS command line encoding, program encoding (including configuration) are all set to Utf-8;

BAT Script Execution Flashback:

1) The script initially has grammatical problems;

2) cmd execution also has a flashback situation, because I changed the code to Utf-8 after the change of the font, I changed to the dot matrix font when it is often wrong.

The above process is very brief, although it has been a long time to troubleshooting, debugging, in fact, only because of the DOS unfamiliar.

I hope that my lessons can be used as a future teacher for reference and study.

Thank You and myself!



Dos Write a simple script + garbled problem

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.