問題は私のset tap=c:\ca\sf\1st 2nd...
などがまったく動かないことです。 echo
に何も表示されない場合、何らかの理由でset
が変数にパスを入れていません。 私はすべてif
の権利を持っています、別の問題はありますか?バッチスクリプト:IFでのSETの問題
setlocal enabledelayedexpansion
if NEWYORK == %region% (
set tap=C:\ny
CALL :process %1 %2 %tap% %cl%
GOTO :EOF
)
if California == %region% (
if '%3'=='sanfrancisco' (
set cl=c:\ca\sf\cl
if '%2'=='1st' set tap=c:\ca\sf\1st
if '%2'=='2nd' set tap=c:\ca\sf\2nd
if '%2'=='3rd' set tap=c:\ca\sf\3rd
if '%2'=='4th' set tap=c:\ca\sf\4th
if '%2'=='5th' set tap=c:\ca\sf\5th
echo %tap%, echo %cl%,
pause
CALL :process %1 %2 %tap% %cl%
GOTO :EOF
)
if '%3' == 'LosAngeles' (
set tap=c:\ca\la
set cl=c:\ca\la\cl
echo %tap%, %cl%
pause
CALL :process %1 %2 %tap% %cl%
GOTO :EOF
)
set tap=c:\USA
set cl=c:\usa\cl
echo %tap%, %cl%
pause
CALL :process %1 %2 %tap% %cl%
GOTO :EOF) else (
echo faiiiiiiiiiillllllllll
pause
GOTO :END)
endlocal
GOTO :EOF
有効にしないでスクリプトを実行するとどうなりますか?あなたの ":プロセス"は何ですか? – weberik
セット*と*エコーが機能しない場合、ほとんどの場合、ブランチ全体は実行されません。 – GolezTrol
他のすべてが動作していますが、 "set = tap = c:\ ca \ sf \ 1st 2nd 3rd etc ... が有効になっていないと、私のプロセスは別のコードになります。コードのこの部分を入れないでください。 – Spaceballs