我想将所有* .jar文件复制到我编写下面脚本的另一个目录
echo Enter path to ILM_HOME:
set /p ILM_HOME=
echo Deployment in progress
copy WEB-INF/lib/*.jar "%ILM_HOME%"/webapp/WEB-INF/lib
我使用C:\Documents and Settings\asimon\Desktop\test
作为输入
它给了我syntax of the command is incorrect
我认为问题是Documents and Settings
我甚至放了"%ILM_HOME%"
而我不需要c:\Docume~1\asimon\Desktop\test
任何其他解决方案?
更新
这是有效的
@echo off
echo
echo Enter path to ILM_HOME:
set /p ILM_HOME=
IF EXIST "%ILM_HOME%\stopApplimation.bat" (
echo Deployment in progress
xcopy WEB-INF\lib\*.jar "%ILM_HOME%\webapp\WEB-INF\lib"
CALL "%ILM_HOME%\stopApplimation.bat"
CALL "%ILM_HOME%\startApplimation.bat"
) ELSE (
echo %ILM_HOME% path is incorrect.
)
对于以下2个语句,任何Linux解决方案对.sh也有帮助
"%ILM_HOME%/stopApplimation.bat"
"%ILM_HOME%/startApplimation.bat"
对于Linux,如何替换上述2个语句?
$ILM_HOME/stopApplimation.sh
$ILM_HOME/startApplimation.sh
答案 0 :(得分:3)
xcopy WEB-INF\lib\*.jar "%ILM_HOME%\webapp\WEB-INF\lib"
?
<强>编辑:强>
在批处理中使用CALL "%ILM_HOME%\stopApplimation.bat"