Jun 1, 2015

Batch - Verify Model & Install Drivers

The following batch file are to check whether the supported model is valid or not and if valid will proceed to next step which is "valid" in this case.

Subsequent batch command is to call the HP SSM built-in command to install the respective drivers automatically.

 
REM Check for valid model & proceed to install.
SET INPUT=Model
for /f "tokens=1,* delims==" %%i IN ('wmic computersystem get %INPUT% /VALUE ^| FIND /I "%INPUT%="') do set Model=%%j
 
ECHO   Found the following model : %Model%
 
IF "%Model%" EQU "HP Compaq 6200 Pro SFF PC" GOTO valid
IF "%Model%" EQU "HP Compaq Pro 6300 SFF" GOTO valid
IF "%Model%" EQU "HP Elite 8300 USDT" GOTO valid
IF "%Model%" EQU "HP ProDesk 600 G1 SFF" GOTO valid
IF "%Model%" EQU "HP EliteDesk 800 G1 SFF" GOTO valid
IF "%Model%" EQU "HP EliteBook 2560p" GOTO valid
IF "%Model%" EQU "HP ProBook 6470b" GOTO valid
IF "%Model%" EQU "HP EliteBook 2570p" GOTO valid
IF "%Model%" EQU "HP EliteBook Folio 9470m" GOTO valid
IF "%Model%" EQU "HP ProBook 640 G1" GOTO valid
IF "%Model%" EQU "HP EliteBook 820 G1" GOTO valid
IF "%Model%" EQU "HP EliteBook 840 G1" GOTO valid
IF "%Model%" EQU "HP EliteBook 1040 G1" GOTO valid
IF "%Model%" EQU "HP Z230 SFF Workstation" GOTO valid

 
Please take note that the model name are {CASE SENSITIVE} and thus extra care required when typing the model name into the batch file.

No comments:

Post a Comment