从批处理文件中您将如何找到硬盘驱动器是 ATA 还是 AHCI?它是存储在我可以解析的文件中的某个地方,还是有一个命令可以找到?
问问题
1508 次
2 回答
0
可能有更好的方法,但这会在此处检测 AHCI:
wmic idecontroller|find /i "ahci">nul && echo AHCI detected
于 2013-07-24T02:02:56.357 回答
0
另一种方法是使用 DXDIAG。像这样的东西:
@ECHO OFF
SET DxDiag=%TEMP%\DxDiag.txt
IF EXIST %DxDiag% DEL /q %DxDiag%
ECHO.Getting DxDiag information for %ComputerName%
ECHO.Please wait...
SET "DxDiagArgs="
REM DxDiag does not work with /64 bit on end, or with quotes on filename
REM START will not wait for 32 bit DxDiag on 64 bit machine
IF DEFINED PROGRAMFILES(x86) SET "DxDiagArgs=%DxDiagArgs%/64bit "
SET DxDiagArgs=%DxDiagArgs%/whql:off /t %DxDiag%
START "" /BELOWNORMAL /WAIT DXDIAG.EXE %DxDiagArgs%
IF NOT EXIST %DxDiag% (
ECHO.DxDiag not available.
GOTO :Done
)
ECHO.
ECHO.Search for the "Disk & DVD/CD-ROM Drives" section in
ECHO.%DxDiag%
ECHO.and parse what you want out of it.
ECHO.
:Done
PAUSE
IF EXIST %DxDiag% DEL /q %DxDiag%
对于每个 ATA 驱动器,您会发现类似的内容: 型号:SAMSUNG HD642JJ ATA Device
于 2013-07-24T02:20:37.403 回答