批处理for语句设置CLASSPATH
@echo off
setlocal EnableDelayedExpansion
for %%i in (d:\*.jar) do (
set CLASSPATH=!CLASSPATH!;%%~fsi
echo !CLASSPATH!
)
@echo off 关闭命令回显
setlocal EnableDelayedExpansion 启用变量延迟
输出结果:
C:\Documents and Settings\zwwangd>D:\test.bat
"";d:\DOM4J-~1.JAR
"";d:\DOM4J-~1.JAR ;d:\JSCH-0~1.JAR
"";d:\DOM4J-~1.JAR ;d:\JSCH-0~1.JAR ;d:\ojdbc14.jar
"";d:\DOM4J-~1.JAR ;d:\JSCH-0~1.JAR ;d:\ojdbc14.jar ;d:\POI-32~1.JAR
阅读(958) | 评论(0) | 转发(0) |