Write the batch file bat

Source: Internet
Author: User

One, a command window that defines a time title

@echo off
: 1
Title Time is:%time%
Goto 1
Pause

Two, determine whether two input characters are equal

@echo off
set/p var= Please enter the first character:
set/p var2= Please enter a second character:
If "%var%" = = "%var2%" (echo US equals) Else echo we're not equal
Pause

Third, compile the Java file

1)
@echo off
CD E:\jenkinsTest

javac-d E:\JENKINSTEST\ZCD\CLASSZCD Testjavac.java
CD E:\JENKINSTEST\ZCD\CLASSZCD
Java Coms.zcd.action.TestJavac


mkdir Practice2
IF%errorlevel%==0 ECHO Success
IF%errorlevel%==1 ECHO fail

: End
Pause

=========
2)
@echo off
CD E:\jenkinsTest

javac-d. \ZCD\CLASSZCD Testjavac.java
CD E:\JENKINSTEST\ZCD\CLASSZCD
Java Coms.zcd.action.TestJavac


mkdir Practice2
IF%errorlevel%==0 ECHO Success
IF%errorlevel%==1 ECHO fail

: End
Pause

===========
3)
@echo off
CD E:\jenkinsTest

javac-d. \ZCD\CLASSZCD Testjavac.java
CD. \ZCD\CLASSZCD
Java Coms.zcd.action.TestJavac


mkdir Practice2
IF%errorlevel%==0 ECHO Success
IF%errorlevel%==1 ECHO fail

: End
Pause
===================================

4)
@echo off
CD E:\jenkinsTest
javac-d. \zcd\classzcd-classpath Lib-djava.ext.dirs=e:\jenkinstest\lib Testjavac.java
CD. \ZCD\CLASSZCD
Java Coms.zcd.action.TestJavac
mkdir Practice2
IF%errorlevel%==0 ECHO Success
IF%errorlevel%==1 ECHO fail
: End
Pause

where javac-d. \zcd\classzcd-classpath lib-djava.ext.dirs=e:\jenkinstest\lib Testjavac.java means compiling Testjavac.java files, and the resulting class file into the current directory subdirectory CLASSZCD directory, and the Java file in the package name to create a corresponding folder,-classpath Lib-djava.ext.dirs=e:\jenkinstest\lib Represents the Testjavac.java dependency E:\jenkinsTest\lib the following package
==============================
5) Compile the current directory all Java files in the subdirectory src
@echo off
CD E:\jenkinsTest
javac-d. \zcd\classzcd-classpath lib-djava.ext.dirs=e:\jenkinstest\lib. \src\*.java
CD. \ZCD\CLASSZCD
Java Coms.zcd.action.TestJavac
mkdir Practice2
IF%errorlevel%==0 ECHO Success
IF%errorlevel%==1 ECHO fail
: End
Pause

Write the batch file bat

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.