Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
:No-Frost:
Old
#1  
:No-Frost:'s Avatar
Senior Member - OP
Thanks Meter 127
Posts: 1,000
Join Date: Sep 2009
Location: Santiago
Default Need an easy programing hand... Create bat file =)...

It's been a long time since the last time I made a bat file and it seems I can't remember how to exactly make one xD... I'm kind of tired of having to put the commands to change the radio, spl and recovery every time, so I've decided to make a simple bat file to be able to choose what files to install if files 1 or 2 (1 being old radio, spl, recovery, and 2 being the new)...

Here is what I got so far xD...

Code:
@echo off
cls
:start
echo.
echo 1. Press 1 to install old files
echo 2. Press 2 to install new files
set choice=
set /p choice=Press 1 or 2 to continue

<--- This section is for option 1 --->(this lines are just to show what option is each)

C:\Android\fastboot flash radio Radio1.img
C:\Android\fastboot flash hboot hboot1.img
C:\Android\fastboot flash recovery recovery1.img
C:\Android\fastboot erase system -w
C:\Android\fastboot reboot-bootloader

<--- End sextion 1 --->

<--- This section is for option 2 --->

C:\Android\fastboot flash radio Radio2.img
C:\Android\fastboot flash hboot hboot2.img
C:\Android\fastboot flash recovery recovery2.img
C:\Android\fastboot erase system -w
C:\Android\fastboot reboot-bootloader

<--- End section 2 --->

fin:
I hope anybody can give me a hand into this =P... I've forgot almost everything in creating this kind of files xD... I know I can make 2 different batch files for the diferents files, but is more commfortable to have everything in just 1 file...

Thanks in advance
Twitter
----------------------------------------
Phone : HTC One
Recovery : CWM
ROM : ARHD (Latest)
----------------------------------------

 
crypysmoker
Old
#2  
crypysmoker's Avatar
Senior Member
Thanks Meter 9
Posts: 970
Join Date: Sep 2009
Location: Somewhere over the rainbow, 2 rights and a left
YEah..... Not sure how much you want to mess with automated Radio/spl installing. those are the 2 most dangerous parts and what happens if you get an error mid way through?

Be careful
If at first you dont succeed, Break it worse and blame the next guy.



Plum Mytouch 4G-SOLD
Mytouch Fender LE (1st ever rooted)SOLD
RETIRED
Desire HD- Sold
Lg G2x -Bricked, recovered then no touch screen

Current- HTC ATT One X-Viper Xl

Universal Androot working for Mytouch 1.2/fender.
 
:No-Frost:
Old
#3  
:No-Frost:'s Avatar
Senior Member - OP
Thanks Meter 127
Posts: 1,000
Join Date: Sep 2009
Location: Santiago
Quote:
Originally Posted by crypysmoker View Post
YEah..... Not sure how much you want to mess with automated Radio/spl installing. those are the 2 most dangerous parts and what happens if you get an error mid way through?

Be careful
That's why I'm including a "press a key to continue" after each part ...

The only problem so far, wast test the script and forgot to make a nandroid backup xD...
Twitter
----------------------------------------
Phone : HTC One
Recovery : CWM
ROM : ARHD (Latest)
----------------------------------------

 
tenderghost
Old
#4  
Junior Member
Thanks Meter 1
Posts: 17
Join Date: Jan 2010
I think this is what you want:
Code:
@echo off

:start
cls
echo 1. Press 1 to install old files
echo 2. Press 2 to install new files
set /p choice=Press 1 or 2 to continue:
if %choice%==1 goto choice1
if %choice%==2 goto choice2

:choice1
echo Choice1 command should go here
set /p anykey=Command complete, press any key to continue...
exit

:choice2
echo Choice2 command should go here
set /p anykey=Command complete, press any key to continue...
exit
Reference:http://en.wikipedia.org/wiki/Batch_file
 
:No-Frost:
Old
#5  
:No-Frost:'s Avatar
Senior Member - OP
Thanks Meter 127
Posts: 1,000
Join Date: Sep 2009
Location: Santiago
Thanks, I've already got a functional batch file...

Now I'm gonna port it to C or something to get a program that works for everybody, that way it would be easier to change the radios and stuff...
Twitter
----------------------------------------
Phone : HTC One
Recovery : CWM
ROM : ARHD (Latest)
----------------------------------------

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...