【起因】-使用VS2005编译生成image后,要拷贝到单板机的SD卡中再从SD卡中启动,这个过程要拷贝好几个映像文件,每次都要在release目录下搜索,费时费力,而烧写NAND启动映像文件也不同,需要重命名,容易出错,于是想到用bat命令实现自动拷贝,代码部分附在文后,主要使用了echo、set、goto、pause、copy、call等命令。
【幕后】-开发过程中发现如下问题:
1.单板机通过Micro Activesync 4.5与PC连接,在电脑中为一系统文件夹“移动设备”,这样在bat文件中无法直接复制文件到其中。我谷歌了一下,有网友
遇到过同样问题,暂无解决办法。有一个办法使用RAPI,有空再研究吧,也恳请广大网友支招^_^
2.bat命令无法往桌面拷贝文件,显示“命令不可用”,我就是下午简单的看了下bat命令,没有系统的学,故不知其因所在,也请大家指教
3.bat文件无法在移动设备中运行,将bat文件放到移动设备中双击发现只能显示文件属性,本想通过这招实现移动设备和PC中的文件传递,⊙﹏⊙b汗
【花絮】经过几天的努力,今天初步实现了自己定制的WinCE6.0 在SBC8100单板机上跑起来,鼠标、键盘、触屏、音频输出、USB-OTG、SD、WIFI、
QQ、MSN、Flash lite、Silverlight、HIV注册表、全中文界面和中文输入等全部支持,很开心,后面要往驱程这一块走,希望WinCE6.0开发之路越走
越顺,感谢谷歌、百度,感谢广大开发爱好者的无私奉献!
【程序】
view sourceprint?01 @echo off
02 @echo 注意:请先确保已做好历史文件备份,该操作将覆盖目录下同名文件
03 @pause
04 :main
05 echo 0.拷贝所有镜像到备份目录下(确保已转移历史版本)
06 echo 1.拷贝SD image到单板机中(确保已同步,文件将拷贝到D盘)
07 echo 2.拷贝NAND image到单板机中(确保已同步,文件将拷贝到D盘)
08 echo 3.拷贝SD image到电脑SD卡中(请确保SD卡插入)
09 echo 4.拷贝NAND image到电脑SD卡中(请确保SD卡插入)
10 echo 5.退出
11 @set /p var=input:
12 call :lab%var%
13
14 @:lab0
15 @echo 5 files to copy...please wait!
16 @echo 1.copy nk.bin...
17 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\nk.bin E:\Arm开发\SBC8100开发\镜像烧写\定制\
18 @echo 2.copy MLO...
19 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\MLO E:\Arm开发\SBC8100开发\镜像烧写\定制\
20 @echo 3.copy EBOOTSD.nb0...
21 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTSD.nb0 E:\Arm开发\SBC8100开发\镜像烧写\定制\
22 @echo 4.copy EBOOTNAND.nb0...
23 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTNAND.nb0 E:\Arm开发\SBC8100开发\镜像烧写\定制\
24 @echo 5.copy XLDRNAND.nb0...
25 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\XLDRNAND.nb0 E:\Arm开发\SBC8100开发\镜像烧写\定制\
26 @echo Copy files done!
27 @goto main
28
29 ::拷贝SD image到D盘
30 @:lab1
31 @echo 3 files to copy...please wait!
32 @if exist D:\EBOOTNAND.nb0 del D:\EBOOTNAND.nb0
33 @if exist D:\XLDRNAND.nb0 del D:\XLDRNAND.nb0
34 @echo 1.copy nk.bin...
35 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\nk.bin D:\
36 @echo 2.copy MLO...
37 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\MLO D:\MLO.exe
38 @echo 3.copy EBOOTSD.nb0...
39 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTSD.nb0 D:\
40 @echo Copy files done!
41 @goto main
42
43 ::拷贝NAND image到D盘
44 @:lab2
45 @echo 4 files to copy...please wait!
46 @if exist D:\EBOOTNAND.nb0 del D:\EBOOTNAND.nb0
47 @if exist D:\EBOOTSD.nb0 del D:\EBOOTSD.nb0
48 @echo 1.copy nk.bin...
49 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\nk.bin D:\
50 @echo 2.copy MLO and rename it as "MLO.exe"...
51 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\MLO D:\MLO.exe
52 @echo 3.copy EBOOTNAND.nb0 and rename it as"EBOOTSD.nb0"...
53 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTNAND.nb0 D:\EBOOTSD.nb0
54 @echo 4.copy XLDRNAND.nb0...
55 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\XLDRNAND.nb0 D:\
56 @echo Copy files done!
57 @goto main
58
59 ::拷贝SD image到电脑SD卡中
60 @:lab3
61 @echo 3 files to copy...please wait!
62 @if not exist j:\ echo 请插入SD卡!
63 @if not exist j:\ goto main
64 @if exist j:\XLDRNAND.nb0 del j:\XLDRNAND.nb0
65 @echo 1.copy nk.bin...
66 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\nk.bin j:\nk.bin
67 @echo 2.copy MLO...
68 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\MLO j:\MLO
69 @echo 3.copy EBOOTSD.nb0...
70 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTSD.nb0 j:\EBOOTSD.nb0
71 @echo Copy files done!
72 @goto main
73
74 ::拷贝NAND image到电脑SD卡中
75 @:lab4
76 @echo 4 files to copy...please wait!
77 @if not exist j:\ echo 请插入SD卡!
78 @if not exist j:\ goto main
79 @if exist j:\EBOOTSD.nb0 del j:\EBOOTSD.nb0
80 @echo 1.copy nk.bin...
81 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\nk.bin j:\nk.bin
82 @echo 2.copy MLO...
83 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\MLO j:\MLO
84 @echo 3.copy EBOOTNAND.nb0 and rename it as"EBOOTSD.nb0"...
85 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\EBOOTNAND.nb0 j:\EBOOTSD.nb0
86 @echo 4.copy XLDRNAND.nb0...
87 @copy D:\WINCE600\OSDesigns\SBC8100\SBC8100\RelDir\SBC8100_ARMV4I_Release\XLDRNAND.nb0 j:\XLDRNAND.nb0
88 @echo Copy files done!
89 @goto main
90
91 ::退出
92 @:lab5
93 exit