:: by bitbyte http://plop.at @echo off if "%1"=="" goto help partlist -d %1|find "primary" > NUL if errorlevel 1 goto no echo primary partition found goto end :no echo no primary partition found goto end :help echo check if primary partition on the drive echo. echo parameter: 0 ...harddisk 1 echo 1 ...harddisk 2 echo. echo example: primary 0 :end