-1
我有一個問題,我的代碼, 我是編程的東西,將所有安裝.NET如果框架中的DirectX 9.0c補丁nessessery和其他一些東西批處理文件編程| if語句不工作
代碼 回聲關閉
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
)
任何改進可以理解
感謝您閱讀
很遺憾我的英語不好
你沒有解釋你在代碼中遇到的問題。 *如果陳述不工作*不是有用的問題描述。它以什麼方式*不工作*? –
如果你想初始化,然後在代碼塊中使用一個變量(在你的情況下,'%arch%''),你需要[延遲擴展](http://stackoverflow.com/questions/9681863/windows-batch - 變量,不會設置)。 – SomethingDark
'如果定義ProgramFiles(x86)(64位回聲)否則(回聲在32位)'會告訴你沒有問。 – 2016-07-27 02:20:35