我有一个批处理文件,用于查看您运行的是 64 位还是 32 位系统。它在我的电脑上很好用,但是当我把它放在 DVD 上运行它时,它就不起作用了。如何让它从 DVD 中正确运行?谢谢
@echo off
IF EXIST "%programfiles(x86)%" (GOTO 64-Bit) ELSE (GOTO 32-Bit)
:32-Bit
ECHO. 32-Bit Operating System Detected
GOTO END
:64-Bit
ECHO. 64-Bit Operating System Detected
GOTO END
:END
echo Press any key to exit...
pause >nul
第二次尝试>>>> 这行得通吗?
@echo.off
for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a:\programfiles(x86) set SysType=%%a:
IF EXIST "%systemroot%\programfiles(x86)" %SysType%\ (GOTO 64-Bit) ELSE (GOTO 32-Bit)
:32-Bit
ECHO. 32-Bit O/S detected
GOTO END
:64-Bit
ECHO. 64-Bit O/S detected
GOTO END
:END
echo.
echo.
echo.
echo Press any key to exit...
pause >nul