从我的DVD运行批处理文件

时间:2013-02-06 18:45:53

标签: file batch-file

我有一个批处理文件,用于查看您运行的是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

SECOND TRY>>>>>这有用吗?

@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

1 个答案:

答案 0 :(得分:1)

@echo off

IF EXIST "C:\WINDOWS\system32\DRVSTORE\GEARAspiWD_1E13C24EB2F28CB6915317F7F17F180ECAA0DB1E\x86" goto :64-Bit
if not exist "C:\WINDOWS\system32\DRVSTORE\GEARAspiWD_1E13C24EB2F28CB6915317F7F17F180ECAA0DB1E\x86" goto :32-Bit

color c
cls
echo.
echo.
echo                                  UNSPECIFIED OPERATING SYSTEM TYPE.
echo -----------------------------------------------------------------------------------------------------------------------------
echo.
echo.
echo.
pause >nul
exit

:32-Bit
ECHO.   32-Bit Operating System Detected
echo.
echo.
pause >nul
goto :END

:64-Bit
ECHO.   64-Bit Operating System Detected.
echo.
echo.
echo.
pause >nul
goto :END

:END
exit

测试并且对我来说工作正常希望它能为你做同样的事情!