From a batch file how would you find if a hard drive is ATA or AHCI? Is it stored somewhere in a file I can parse or is there a command to find out?
How to find out if HDD is ATA or AHCI?
1.7k Views Asked by user2526047 At
2
There are 2 best solutions below
0

Another way is to use DXDIAG. Something like this:
@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%
You will find something like this for each ATA drive: Model: SAMSUNG HD642JJ ATA Device
There may be better methods but this detects AHCI here: