2013-05-28 4 views
0

이것은 Windows 명령 줄에서 스크립팅을 한 첫 시도입니다. 나는 변수를 사용하여 읽고 쓸 수있는 명령을 작성하려고합니다. 불행하게도 나는 스크립트가 제대로 작동하지 못하게하고, Pause_는 cmd 창이 열린 상태로 유지하지 못하여 어떤 일이 잘못 될지 알 수 있습니다. 아래는 지금까지 작성한 스크립트입니다. 변수를 사용하여 cmd 스크립트 길이 줄이기

@echo off 
:: Script for generating java classes from xsd using jibx 
:: 
:: Create variables for the different paths for easy editing later 
set jibx = ../../Libraries/jibx/lib/jibx-tools.jar 
set CodeGen = org.jibx.schema.codegen.CodeGen 
set package = src/com/TersoSolutions/Jetstream/SDK/ 
set source = resources/xsd/ 
set binding = resources/bindings/ 
:: 
:: 
:: First Command 
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd 
:: 
:: Repeat the command 
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse2.xml -p %package%Application/Model/GetConfigurationResponse2 %source%Application/1.1/GetConfigurationResponse.xsd 
:: 
Pause_ 

목적

내가 내가 달성하기 위해 필요한 모든 작업을 나열 할 수있는 방식으로 스크립트를 작성 할 수 있는지 확인하기 위해 유사한 방식으로 명령을 반복하는 것이 었습니다.

편집 : 첫째

java -cp ../../Libraries/jibx/lib/jibx-tools.jar org.jibx.schema.codegen.CodeGen -b /resources/bindings/GetConfigurationResponse.xml -p com.TersoSolutions.JetStream.SDK.Application.Model.GetConfigurationResponse /resources/xsd/Applicationi/1.1/GetConfigurationResponse.xsd 
+0

입니다

그들을 설정 한 후 echo 당신의 변수로 시도, 당신의 조각을 디버깅하려면? cmd.exe를 열고 스크립트를 실행하여 오류 (아마도 Pause_ 인식 할 수 없음)를 확인하십시오. – Ofiris

+0

쉼표 뒤에 _이 없어야합니다.이 튜토리얼의 실수는 다음과 같습니다. – JME

+0

지금 수정 되었습니까? – Ofiris

답변

1

을 다음과 같이

내가 스크립트에서 복제하려고 명령은 명령 줄에서 직접 작동, Pause_Pause해야한다.

둘째, Set 명령에는 공백을 사용하지 마십시오.

set binding = resources/bindings/ 
echo binding 
>>>%binding% 

set binding=resources/bindings/ 
echo binding 
>>>resources/bindings/ 
0

이 시도 : Pause_ 무엇

 
@echo off&setlocal 
:: Script for generating java classes from xsd using jibx 
:: 
:: Create variables for the different paths for easy editing later 
set "jibx=../../Libraries/jibx/lib/jibx-tools.jar" 
set "CodeGen=org.jibx.schema.codegen.CodeGen" 
set "package=com.TersoSolutions.JetStream.SDK." 
set "source=/resources/xsd/" 
set "binding=/resources/bindings/" 
:: 
:: 
:: First Command 
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd 
:: Repeat the command 
java -cp %jibx% %CodeGen% -b %binding%GetConfigurationResponse.xml -p %package%Application/Model/GetConfigurationResponse %source%Application/1.1/GetConfigurationResponse.xsd 
Pause