Need to launch BIOS update files

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#16 Post by rfdr81 » 27 Mar 2013 02:26

using windows 7 professional.

my batch file is this one:

@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

copy and paste just like you gave to me.

And the txt file is:
PSAT2|f:\BIOStosh\psat2\Pflash.exe


is there another way? maybe put in the batch file the map of the models without using a .txt file?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Need to launch BIOS update files

#17 Post by foxidrive » 27 Mar 2013 02:46

rfdr81 wrote:my batch file is this one:

@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

copy and paste just like you gave to me.


You have errors in the batch file. It's not copy and pasted properly.

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#18 Post by rfdr81 » 27 Mar 2013 02:57

@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"
))


this is waht you post yesterday..copy and paste here and paste in the batch on the usb. Give the same error...

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Need to launch BIOS update files

#19 Post by foxidrive » 27 Mar 2013 03:18

No, it gives no error if you have the file in that location.

If the file does not exist then this is what you see which is telling you that the file doesn't exist.

PA Number: PSAT2
'"f:\biostosh\psat2\Pflash.exe"' is not recognized as an internal or external command,
operable program or batch file.

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#20 Post by rfdr81 » 27 Mar 2013 03:34

ok, maybe the problem is from me, but this is your batch file( copy and paste just like you postes yesterday without any alteration)

@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"
))

this is the file.txt:
PSAT2|f:\biostosh\psat2\Pflash.exe

the update file is pflash.exe, is on f:\biostosh\psat2

put to test on the QUEMU emulator, gives the error tha i told you before.

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#21 Post by rfdr81 » 27 Mar 2013 04:21

copy this last line but give the same error: syntax error, bad variable..

mfm4aa
Posts: 70
Joined: 13 Feb 2013 14:02
Location: Europe

Re: Need to launch BIOS update files

#22 Post by mfm4aa » 27 Mar 2013 04:28

I have an other idea. Put the file.txt and the batch in the same folder and try this:

Code: Select all

@echo off
set "pa="
set /p "pa=PA Number: "
if defined pa (
for /f "usebackq tokens=1,* delims=|" %%a in ("%~dp0file.txt") do (
if /i "%%a"=="%pa%" "%%b"
))

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#23 Post by rfdr81 » 27 Mar 2013 04:43

don´t konow why doesnt work... The line PA number appears correctly, i put the model(psat2) enter, then gives error:

Syntax error.
bad variable specification
bad comand or file name - "))"

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#24 Post by rfdr81 » 27 Mar 2013 04:55

try to do in other way...it is possible something like this, a batch file?

@echo off

rem *** jump to model according to PA number ***
goto %cPAshort%

:PLL2E
:PSAT2
here create a folder were the file to update is and run it...

When we put the correct string on the top he goes to correct folder and run it...it is possible?

mfm4aa
Posts: 70
Joined: 13 Feb 2013 14:02
Location: Europe

Re: Need to launch BIOS update files

#25 Post by mfm4aa » 27 Mar 2013 05:20

Try to remove the double quotes around %%b:

Code: Select all

@echo off
set "pa="
set /p "pa=PA Number: "
if defined pa (
for /f "usebackq tokens=1,* delims=|" %%a in ("%~dp0file.txt") do (
if /i "%%a"=="%pa%" %%b
))

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#26 Post by rfdr81 » 27 Mar 2013 05:24

Ok, works fine now made by this form!

Thakns all for the help.

mfm4aa
Posts: 70
Joined: 13 Feb 2013 14:02
Location: Europe

Re: Need to launch BIOS update files

#27 Post by mfm4aa » 27 Mar 2013 05:33

Did you make it with goto: ?

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Re: Need to launch BIOS update files

#28 Post by rfdr81 » 27 Mar 2013 05:44

without goto

mfm4aa
Posts: 70
Joined: 13 Feb 2013 14:02
Location: Europe

Re: Need to launch BIOS update files

#29 Post by mfm4aa » 27 Mar 2013 06:00

nice :D

rfdr81
Posts: 25
Joined: 26 Mar 2013 04:29

Question to confirm choice

#30 Post by rfdr81 » 04 Apr 2013 04:06

It is possible after put the model that we want, appear a question to confirm the choice and put yes or no to confirm?

Post Reply