2011-01-21 3 views
2

를 배치하지, 이름하여 Windows 배치 파일 매개 변수를 가져 오기 :나는 다음과 같은 방법으로 Windows 배치 파일을 실행하면

myscript.bat -c 789 -b test 

가장 좋은 방법은 무엇입니까 :

myscript.bat -b test -c 789 

또는 다음과 같은 방법으로

c 값을 안정적으로 얻으려고합니까?

+1

중복 : HTTP : //stackoverflow.com/questions/3973824/windows-bat-file-optional-argument-parsing –

답변

2

방법 :


IF _%1==_b echo do something with %2 
IF _%1==_c echo do something with %2 
IF _%3==_b echo do something with %4 
IF _%3==_c echo do something with %4 

관련 문제