|
Answer» Hello, need some help please. I need to creat( if possible) one batch that permit to make a search and EXECUTE the file that i searched for. Example I have several bios updates from several models, for example: I have PSTA2, PTA2E, PDVX3(inside of each folder there is the bios .exe. So the idea is to creat a batch file and we execute it ask to input the model to search. we put PSTA2 for example ask for confirmation and execute the update bios. In many CASES the differents models(PSAT2,PSAT3,PSAXL, etc...) uses the same file to update the bios. So the idea is: i want to put a search line where i put the model name(PSAT2,PSAT3,PSAXL, etc...) in a way that e runs the right file to make the update. Eaxample: PSAT2,PSAT3,PSAXL, use the same bios file to update(let´s call bios.exe). When i put in the search line PSAT2 runs the bios.exe, if i put PSAT3 runs the same bios.exe .
But to do this i need a way to "say" that file, bios.exe, gives to PSAT2,PSAT3,PSAXL because is the same.With all the incorrect things that can happen with a flash a batch file to run one would be the last project i'd ever consider.iHello patio, agree waht you said, but this is to make my job easy. i am a CERTIFIED in Toshiba and HP and they have a huge number of bios updates for the laptops and PC. The idea is to put all in the same Usb flash to make the job easy.This little snippet is meant more to show method than a solution. I agree that using a batch file to flash a BIOS MIGHT be a bit risky.
Code: [Select]@echo off setlocal enabledelayedexpansion
:loop set /p model=Enter Model: set /p verify=Re-Enter Model: if /i %verify% NEQ %model% goto loop for %%v in (PSAT2, PSAT3, PSAXL) do ( if /i !model! EQU %%v bios.exe & goto :eof )
for %%v in (PSAT4, PSAT5) do ( if /i !model! EQU %%v bios1.exe & goto :eof )
The key is the for instruction. Within the first set of parens is a list of the model numbers that will execute a common bios flash. Each for statement has it's own set of model numbers which execute a different bios flash. You can have as many for statements a required. The & goto :eof is likely not needed as the flash will probably need a boot, ending the batch file.
Rather than depending on user input, you can replace the loop CONSTRUCT and extract the model directly from the machine:
wmic computersystem get model
You probably need to add path information to the flash files.
|