openjtag+oflash+s3c2440裸机 bin文件一键烧入nandflash脚本V2版

@echo off
color 07
title=openjtag+oflash+s3c2440裸机 bin文件一键烧写辅助 by嘎子
echo 支持2种操作方式 ,永久更新地址 http://xouou.iteye.com/blog/1840823  ,当前是V2版本 
echo.
echo 1.拖拽方式,将任意目录中的bin文件拖拽到"2440裸机烧写辅助.bat"程序图标上即可
echo 2.非拖拽方式,运行本bat脚本,输入bin文件名
echo   在非拖拽方式下,点'取消'按钮进入原始cmd模式,和平时一样
echo.
cd /d "%~dp0"
set filename=%~nx1
set pats=%~dp1
if  exist %temp%\autoburn.vbs  goto goon
echo 在%temp%目录创建子脚本,仅创建和提示1次
echo.
echo dim str,args  >%temp%\autoburn.vbs
echo Set args = WScript. Arguments    >>%temp%\autoburn.vbs
echo If args.count =0 Then    >>%temp%\autoburn.vbs
echo do while (1) >>%temp%\autoburn.vbs
echo str=inputbox("请输入bin文件名,例如:led.bin            按'取消'退出") >>%temp%\autoburn.vbs
echo if str=false then >>%temp%\autoburn.vbs
echo sendMsgs(1) >>%temp%\autoburn.vbs
echo end if >>%temp%\autoburn.vbs
echo if not str = vbNullString or  IsEmpty(str) then >>%temp%\autoburn.vbs
echo sendMsgs(0) >>%temp%\autoburn.vbs
echo exit do >>%temp%\autoburn.vbs
echo end if >>%temp%\autoburn.vbs
echo loop   >>%temp%\autoburn.vbs
echo Else >>%temp%\autoburn.vbs
echo str=args(0) >>%temp%\autoburn.vbs
echo sendMsgs(0) >>%temp%\autoburn.vbs
echo END If >>%temp%\autoburn.vbs
echo function sendMsgs(bQuit) >>%temp%\autoburn.vbs
echo set ws=createobject("wscript.shell")  >>%temp%\autoburn.vbs
echo ws.appactivate "openjtag+oflash+s3c2440裸机 bin文件一键烧写辅助 by嘎子" >>%temp%\autoburn.vbs
echo Wscript.SLEEP 30 >>%temp%\autoburn.vbs
echo if bQuit=1 then >>%temp%\autoburn.vbs
::若启用该代码,点弹窗的取消按钮时,cmd窗口也会关闭,否则仅关闭子窗口,cmd主窗口进入原始手动命令模式
::echo ws.SendKeys "exit/y/q{enter}" >>%temp%\autoburn.vbs 
echo WScript.Quit >>%temp%\autoburn.vbs
echo end if >>%temp%\autoburn.vbs
echo ws.SendKeys "oflash 0 1 0 0 0 "+str+"{enter}" >>%temp%\autoburn.vbs
echo WScript.Quit >>%temp%\autoburn.vbs
echo end function >>%temp%\autoburn.vbs
:goon
if /i not  "%~1"=="" goto autoburn2 
::如果使用非拖拽方式,请修改pats路径,为了支持有空格的路径,请在路径上加双引号
set pats="F:\光盘\2440资料\jz2440光盘\bin\hardware" 
cd /d %pats%
:autoburn1
echo ===============[非拖拽方式],请输入bin文件名====================
echo 使用前请确定第48行代码的pats路径为bin文件所在目录
echo.
wscript %temp%\autoburn.vbs 
cmd /k cd/d %pats% 
exit
:autoburn2
echo  ====================[拖拽方式]=========================
echo 烧入nandflash的bin文件: %filename%
wscript %temp%\autoburn.vbs %filename%
cmd /k cd/d %pats% 
exit

 



 

 

 

 

得知oflash支持多个参数 ,故V2版合并10行代码 ,功能没变

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值