Sign in with
Sign up | Sign in
Your question

Batch file to run updates

Last response: in Windows 7
Share
April 9, 2013 2:25:16 AM

hello
i have this code:

@echo off

rem *** jump to model according to PA number ***

set "pa"=
set /p "pa"=PA Number:


:p SAT1

:p SAT2

cd biostosh\bios1.exe


:p XLL1
cd biostosh\bios2.exe



the objective is to put this batch file in a USB drive in order to run the new bios for PC.
Some models use the same bios file.
This code works, but if i put the "PSAT1" goes to bios1.exe, and PXLL1 goes to the same file, when should go to bios2.exe.What can i do to put this to work?
There will bem more than 100 different models so i need a way to put it to work in
Need help please,
i am a novice in this bath things..

More about : batch file run updates

April 9, 2013 3:32:27 AM

Hi,

You need to put in some gotos to actually tell the interpreter to go to the appropriate place in the file.

Try:

  1. set pa=
  2. set /p pa=PA Number:
  3.  
  4. goto %PA%
  5.  
  6. :PSAT1
  7. :PSAT2
  8. cd biostosh\bios1.exe
  9. goto :EOF
  10.  
  11. :PXLL1
  12. cd biostosh\bios2.exe
  13. goto :EOF


The "goto :EOF" lines tell the interpreter to jump to the end of the file - otherwise it would keep going with the next section, running the PXLL1 update after it finishes the PSAT1 or PSAT2 update. (I assume PSAT1 and PSAT2 are intended to have the same BIOS.)

Hope this helps. Get in touch if you need more info.

[Edit: the preview had unwanted line numbers so I advised ignoring them when typing the code - the final post didn't have them]
m
0
l
!