如何确定硬盘是ATA还是AHCI?

时间:2013-07-23 23:16:19

标签: batch-file ata

从批处理文件中,您如何找到硬盘驱动器是ATA还是AHCI?它是存储在我可以解析的文件中的某个位置还是有命令要查找?

2 个答案:

答案 0 :(得分:0)

可能有更好的方法,但这可以在这里检测到AHCI:

wmic idecontroller|find /i "ahci">nul && echo AHCI detected

答案 1 :(得分: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设备