-1
作業 されていない場合、私はnessesseryとバッチファイルプログラミング|声明は、私は私のコードに問題がある
コード が
をオフエコーいくつかの他のものの場合、.NETは、DirectXの9.0c以降のパッチをフレームワークのすべてをインストールします何かをプログラミングしてecho \====================================/
echo/A repackage of all essential files \
echo \ that are required to be installed/
echo/so installing them manually isn't \
echo \ a big problem. /
echo /====================================\
echo \ Continue at your own risk!!! /
echo /====================================\
echo.
echo Type yes to continue or no to cancel:
set /p Reponse=""
cls
if %Reponse% == yes (
echo what's is your CPU architecture? 32-Bit or 64-Bit?
echo to help, look at your ram, if it's below the 4GB Then its 32-bit
set /p arch=""
if %arch% == 32-bit (
cls
echo starting Installation
)
echo starting installation process
)
if %Reponse% == no (
echo Shutting Down
echo Thank you for your participation
)
pause
壊れた部分:
:if %Reponse% == yes (
echo what's is your CPU architecture? 32-Bit or 64-Bit?
echo to help, look at your ram, if it's below the 4GB Then its 32-bit
set /p arch=""
if %arch% == 32-bit (
cls
echo starting Installation
)
echo starting installation process
)
コードのこの部分が存在しない場合、それは働いています
echo what's is your CPU architecture? 32-Bit or 64-Bit?
echo to help, look at your ram, if it's below the 4GB Then its 32-bit
set /p arch=""
if %arch% == 32-bit (
cls
echo starting Installation
)
任意の改善がこれは環境変数がバッチファイル内のブロックの内部で展開されているかに関係している
あなたはコードに関する問題について説明していません。 * if文が動作しない*は、有用な問題記述ではありません。どのようにして*働いていないのですか? –
コードブロック内で変数(あなたの場合は '%arch%')を初期化して使用するには、[遅延拡張]が必要です(http://stackoverflow.com/questions/9681863/windows-batch -variables-wont-set)。 – SomethingDark
'If定義されたProgramFiles(x86)(64ビットのエコー)Else(エコーオン32ビット)'は尋ねることなくあなたに伝えます。 –