Need to launch BIOS update files
Moderator: DosItHelp
Need to launch BIOS update files
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.
Can anybody help me on this task?
Thanks
Can anybody help me on this task?
Thanks
Re: Need help to creat a specific batch file
Untested:
Code: Select all
@echo off
set "file="
set /p "file=Enter the filename [without .exe]: "
if defined file (
for /f "delims=" %%a in ('dir "%file%.exe" /a-d /b /s') do "%%a"
)
Re: Need help to creat a specific batch file
Thanks for the help foxidrive
Ok, to put the name(PSTA2, etc) works fine. I have a doubt: each PST2,PST3X,etc is a folder and inside of each there is the correct bios.exe file
the commands that you program do this? When i write "PST2" will open the folder respective and run automatically the bios.exe?The same for all folders and bios.exe... And ai want to put all folders in a main folder because ia have bios from different manufactures. I have the root of the pen and the a main folfer withe the name of manufacturer(toshiba for example) and inside folder toshiba the folder with each model(PSAT2,PSA3X,etc..)
Ok, to put the name(PSTA2, etc) works fine. I have a doubt: each PST2,PST3X,etc is a folder and inside of each there is the correct bios.exe file
the commands that you program do this? When i write "PST2" will open the folder respective and run automatically the bios.exe?The same for all folders and bios.exe... And ai want to put all folders in a main folder because ia have bios from different manufactures. I have the root of the pen and the a main folfer withe the name of manufacturer(toshiba for example) and inside folder toshiba the folder with each model(PSAT2,PSA3X,etc..)
Re: Need help to creat a specific batch file
Put it in the main folder and run it.
You type the exe file name without the exe on it and it will run it, if it is a unique name.
If you want something else then explain further.
You type the exe file name without the exe on it and it will run it, if it is a unique name.
If you want something else then explain further.
Re: Need help to creat a specific batch file
Again thanks, ok tha basic idea is there, but i´ll try to better explain what i need. For example let´s go for Toshiba. I have several models(PSAT2,PSAT3,PSAXL, etc...) 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 write file tu 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.
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.
Re: Need help to creat a specific batch file
It would depend on your folder structure and how many exe files are in each directory.
Or you could create a file that maps the correct BIOS file to the correct model: for example:
===[file starts here]===
PSAT2|c:\bios\toshiba\psat2\bios.exe
PSAT3|c:\bios\toshiba\psat2\bios.exe
PSAXL|c:\bios\toshiba\psat2\bios.exe
PS123|c:\bios\toshiba\ps123\biosABC.exe
EP45-UD3R|c:\bios\Gigabyte\EP45\bios12.exe
and with that one can easily use a batch file to run the correct BIOS file.
Or you could create a file that maps the correct BIOS file to the correct model: for example:
===[file starts here]===
PSAT2|c:\bios\toshiba\psat2\bios.exe
PSAT3|c:\bios\toshiba\psat2\bios.exe
PSAXL|c:\bios\toshiba\psat2\bios.exe
PS123|c:\bios\toshiba\ps123\biosABC.exe
EP45-UD3R|c:\bios\Gigabyte\EP45\bios12.exe
and with that one can easily use a batch file to run the correct BIOS file.
Re: Need help to creat a specific batch file
ill try to show what i want in practice: This will be my first menu i´ll run on a usb flash disk that i already have configured and is working) MENU
MENU ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
MENU º UTILS
MENU ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
MENU º 1. TOSH - BIOS
MENU º 2. HP - BIOS
So when i press option 1, enter to the line(that you first give me) to put the model name(PSAT2, etc) goes to the correct bios file.
I create on the root the pen a folder "biostosh" and inside this folder i want to put the bios files for each model. The option you give creating file map i think is a good solution.
So what is the "final structure of the batch file?
@echo off
set "file="
set /p "file=PA Number:
if defined file (
for /f "delims=" %%a in ('dir "%file%.exe" /a-d /b /s') do "%%a
How can i use this lines of command to join to this above?
PSAT2|c:\bios\toshiba\psat2\bios.exe
PSAT3|c:\bios\toshiba\psat2\bios.exe
PSAXL|c:\bios\toshiba\psat2\bios.exe
PS123|c:\bios\toshiba\ps123\biosABC.exe
EP45-UD3R|c:\bios\Gigabyte\EP45\bios12.exe
MENU ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
MENU º UTILS
MENU ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
MENU º 1. TOSH - BIOS
MENU º 2. HP - BIOS
So when i press option 1, enter to the line(that you first give me) to put the model name(PSAT2, etc) goes to the correct bios file.
I create on the root the pen a folder "biostosh" and inside this folder i want to put the bios files for each model. The option you give creating file map i think is a good solution.
So what is the "final structure of the batch file?
@echo off
set "file="
set /p "file=PA Number:
if defined file (
for /f "delims=" %%a in ('dir "%file%.exe" /a-d /b /s') do "%%a
How can i use this lines of command to join to this above?
PSAT2|c:\bios\toshiba\psat2\bios.exe
PSAT3|c:\bios\toshiba\psat2\bios.exe
PSAXL|c:\bios\toshiba\psat2\bios.exe
PS123|c:\bios\toshiba\ps123\biosABC.exe
EP45-UD3R|c:\bios\Gigabyte\EP45\bios12.exe
Re: Need help to creat a specific batch file
rfdr81 wrote:How can i use this lines of command to join to this above?
PSAT2|c:\bios\toshiba\psat2\bios.exe
PSAT3|c:\bios\toshiba\psat2\bios.exe
PSAXL|c:\bios\toshiba\psat2\bios.exe
PS123|c:\bios\toshiba\ps123\biosABC.exe
EP45-UD3R|c:\bios\Gigabyte\EP45\bios12.exe
With this you would have to know the model number that you need - it would search the file for the model number and then execute the BIOS file.
If you did not enter a PA number then it would quit.
Code: Select all
@echo off
set "pa="
set /p "pa=PA Number: "
if defined pa (
for /f "tokens=1,* delims=|" %%a in (file.txt) do (
if /i "%%a"=="%pa%" "%%b"
))
Re: Need help to creat a specific batch file
Thanks for all the help and tips. I will try to put to work
Thanks
Thanks
Re: Need help to creat a specific batch file
can you please tell me waht to put on the .txt file ?
Re: Need help to creat a specific batch file
you mean the file.txt ?
I gave you some examples - can you explain what more you need to know?
The format is:
modelnumber|drive:\path\biosfile.exe
I gave you some examples - can you explain what more you need to know?
The format is:
modelnumber|drive:\path\biosfile.exe
Re: Need help to creat a specific batch file
I made a litle test, put this in the txt file:
PSAT2|f:\biostosh\psat2\Pflash.exe f:\is the usb pen
I suceed to put the PA number, but when go Enter key gives an error, syntax error, bad variable specification
PSAT2|f:\biostosh\psat2\Pflash.exe f:\is the usb pen
I suceed to put the PA number, but when go Enter key gives an error, syntax error, bad variable specification
Re: Need help to creat a specific batch file
rfdr81 wrote:I made a litle test, put this in the txt file:
PSAT2|f:\biostosh\psat2\Pflash.exe f:\is the usb pen
I suceed to put the PA number, but when go Enter key gives an error, syntax error, bad variable specification
I put this in file.txt
PSAT2|f:\biostosh\psat2\Pflash.exe
and I used this code, which only echos the path to the bios:
Code: Select all
@echo off
set "pa="
set /p "pa=PA Number: "
if defined pa (
for /f "tokens=1,* delims=|" %%a in (file.txt) do (
if /i "%%a"=="%pa%" echo "%%b"
))
pause
and I got this: it works here.
PA Number: psat2
"f:\biostosh\psat2\Pflash.exe"
Press any key to continue . . .
Try it with the above, and then remove the 'echo' to enable launching the exe file.
Re: Need help to creat a specific batch file
i dont know what im doing wrong, put everything like you tested but gives me:
PA Number: psat2
Syntax error
bad variable specification
bad command or file name - "))".
press any key to continue
PA Number: psat2
Syntax error
bad variable specification
bad command or file name - "))".
press any key to continue
Re: Need help to creat a specific batch file
What version of Windows are you running?
Did you copy and paste the code?
Did you copy and paste the code?