Jump to content

need help from masters...


john21
 Share

Recommended Posts

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..

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...