@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行代码 ,功能没变