一个简单批处理的难题
@ECHO OFF
for %%i in (c d e f g h i j ) do if exist %%i:\SYS.gho GOTO label
goto err
:label
label %%i:SYSTEM
md %%i:\boot
copy aa.txt %%i:\boot
goto exit
:err
echo nofile
:exit
批处理的意思是:如果C分区存在SYS.GHO文件,就跳转到:label执行相应命令,不再继续查找其它分区,如此类推。。。。。。
但按上面的编写执行出错。不少网友给了不同的解决方案,但都没有正确的。
请willsort等高手出手!
@ECHO OFF
for %%i in (c d e f g h i j ) do if exist %%i:\SYS.gho GOTO label
goto err
:label
label %%i:SYSTEM
md %%i:\boot
copy aa.txt %%i:\boot
goto exit
:err
echo nofile
:exit
批处理的意思是:如果C分区存在SYS.GHO文件,就跳转到:label执行相应命令,不再继续查找其它分区,如此类推。。。。。。
但按上面的编写执行出错。不少网友给了不同的解决方案,但都没有正确的。
请willsort等高手出手!


