windows dos/cmd 脚本示例,set ,choice,xcopy,notepad

简单的window的批处理.bat脚本编辑实例,用于笔记,不喜勿喷。

@echo off
echo -----------TDZ IS PLEASURE TO ASSIST YOU :)-----------
echo.
echo.
echo -----------Choose your platform!!!-----------
echo.
echo.
set message=[1]Amlogic 4.4/5.1/6.0,  [2]Amlogic 7.1,  [3]Amlogic 9.0 CTS,  ^
[4]RK,  [5]RTD1295

set meta_info_dir_name=META-INF
set meta_info_dir_Amlogic445160=meta_info\4.4,5.1,6.0
set meta_info_dir_Amlogic71=meta_info\7.1
set meta_info_dir_Amlogic90CTS=meta_info\META_INF_Amlogic90CTS
set meta_info_dir_RK=meta_info\RK
set meta_info_dir_RTD1295=meta_info\RTD1295

::set main_dir=%~dp0
::F:\GeniatechPatchTools\patch_tools_20181112_xuenian\
::echo %main_dir%

set update_dir=update\%meta_info_dir_name%
set update_file_updater_script_path=%update_dir%\com\google\android\updater-script

choice /C 12345 /M "%message% :"
if %errorlevel%==1 goto Amlogic445160
if %errorlevel%==2 goto Amlogic71
if %errorlevel%==3 goto Amlogic90CTS
if %errorlevel%==4 goto RK
if %errorlevel%==5 goto RTD1295

:Amlogic445160
 xcopy %meta_info_dir_Amlogic445160%\%meta_info_dir_name%  /E /R /I /Y /C  %update_dir%
 echo -----------copy Amlogic445160 success!!!Press any key to modify updater-script!!!-----------
 pause > nul
 goto finish_choose_platform
:Amlogic71
 xcopy %meta_info_dir_Amlogic71%\%meta_info_dir_name% /E /R /I /Y /C  %update_dir%
 echo -----------copy Amlogic71 success!!!Press any key to modify updater-script!!!-----------
 pause > nul
 goto finish_choose_platform
:Amlogic90CTS
 xcopy %meta_info_dir_Amlogic90CTS%\%meta_info_dir_name% /E /R /I /Y /C %update_dir%
 echo -----------copy Amlogic90CTS success!!!Press any key to modify updater-script!!!-----------
 pause > nul
 goto finish_choose_platform
:RK
 xcopy %meta_info_dir_RK%\%meta_info_dir_name%  /E /R /I /Y /C  %update_dir%
 echo -----------copy RK success!!!Press any key to modify updater-script!!!-----------
 pause > nul
 goto finish_choose_platform
:RTD1295
 xcopy %meta_info_dir_RTD1295%\%meta_info_dir_name% /E /R /I /Y /C  %update_dir%  
 echo -----------copy RTD1295 success!!!Press any key to modify updater-script!!!-----------
 pause > nul
 goto finish_choose_platform

:finish_choose_platform
::echo %update_file_updater_script_path%
notepad %update_file_updater_script_path%

echo -----------Close and save your script file first then press any key to continue!!!-----------
pause > nul

echo.
echo.
echo -----------:)Input your platform box name!!!(as:ATV370,ATV390R,495MAX...)-----------
set /p platform=:
echo.
echo.
echo -----------:)Input your platform system version!!!(as:...7.1,8.0,8.1...)-----------
set /p android_version=:
echo.
echo.
echo -----------:)Input your custom name!!!(as: AA,CC...)-----------
set /p custom_name=:
echo.
echo.
set patch_name=patch_%platform%_%android_version%_%custom_name%_ %date:~0,4%%date:~5,2%%date:~8,2%.img
echo Your output file name will be as %patch_name%

choice /C:YN /M Yes,No
if %errorlevel%==1 goto Yes
if %errorlevel%==2 goto No

:Yes
 echo yes!!!!
 cd update
 ..\sign_on_win\7z.exe a ..\update.zip *
 cd ..\
 java -Xms700m -Xmx1024m -jar sign_on_win\signapk.jar -w sign_on_win\testkey.x509.pem  sign_on_win\testkey.pk8  update.zip  update.img
 ren "update.img" "%patch_name%"
 del update.zip
 echo.
 echo.
 echo  -----------Congratulate,please exit via any key,it is time to say goodbye,love you!!!(crying)-----------
 pause > nul
goto No
 
:No
echo no!!!!

exit

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值