Sign in to follow this  
Followers 0
john21

need help from masters...

4 posts in this topic

dear moderator am new in autoit and trying to make one application..plz help me to understanding how to code...i tried below code but not get sucess...

Func BUTTON15CLICK()
    Local $CLEAR = GUICtrlSetData($RESULT, "Backuping Rom of Your Device On SD Card...")
    Run(@ComSpec & " /c c:\adb.exe shell rm -r /sdcard/backup ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb.exe shell mkdir /sdcard/backup ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd0 of=/sdcard/backup/misc.img bs=4096", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd1 of=/sdcard/backup/kernel.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd2 of=/sdcard/backup/boot.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd3 of=/sdcard/backup/recovery.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd4 of=/sdcard/backup.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd5 of=/sdcard/backup/cache.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb shell dd if=/dev/mtd/mtd8 of=/sdcard/backup/system.img bs=4096 ", @ScriptDir, @SW_HIDE)
    Run(@ComSpec & " /c c:\adb.exe pull /sdcard/backup  ", @ScriptDir, @SW_HIDE)
EndFunc

orignal .bat file code is....

adb shell cat /proc/cpuinfo
echo ________________________________________________________________________________
adb shell lsmod
echo ________________________________________________________________________________
adb shell cat /proc/mtd
echo ________________________________________________________________________________
echo aer you sure to backup rom
echo mtd0 misc
echo mtd1 kernel 
echo mtd2 boot
echo mtd3 recovery
echo mtd4 backup 
echo mtd5 cache
echo mtd8 system


pause
adb.exe shell rm -r /sdcard/backup
adb.exe shell mkdir /sdcard/backup
echo backup/misc.img
adb shell dd if=/dev/mtd/mtd0 of=/sdcard/backup/misc.img bs=4096
echo backup/kernel.img
adb shell dd if=/dev/mtd/mtd1 of=/sdcard/backup/kernel.img bs=4096
echo backup/boot.img
adb shell dd if=/dev/mtd/mtd2 of=/sdcard/backup/boot.img bs=4096
echo backup/recovery.img
adb shell dd if=/dev/mtd/mtd3 of=/sdcard/backup/recovery.img bs=4096
echo sdcard/backup.img
adb shell dd if=/dev/mtd/mtd4 of=/sdcard/backup.img bs=4096
echo backup/cache.img
adb shell dd if=/dev/mtd/mtd5 of=/sdcard/backup/cache.img bs=4096
echo backup/system.img
adb shell dd if=/dev/mtd/mtd8 of=/sdcard/backup/system.img bs=4096
echo pull /sdcard/backup john
if exist _input rmdir /S /Q john
mkdir rk_rom_backup
adb.exe pull /sdcard/backup john

echo Finished

plz help masters..need urgentally..

Share this post


Link to post
Share on other sites



Welcome to AutoIt and the forum!

Can you please describe what you mean by "not get sucess..."?

Do you get error messages? Does your script run the adb program?

We need more infor to help you.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

I'd use RunWait rather than Run.

Share this post


Link to post
Share on other sites

And check the return code before proceeding to the next step. Something like:

RunWait(@ComSpec & " /c c:\adb.exe shell rm -r /sdcard/backup ", @ScriptDir, @SW_HIDE)
If @error then Return @error ; Returns the error code to the function call
1 person likes this

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0