无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 2639|回复: 3
打印 上一主题 下一主题

请教..DOS下面无法运行bat

[复制链接]
跳转到指定楼层
1#
发表于 2010-7-23 01:42:35 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请教各位大虾..小弟做了个dos下的批处理 用来在DOS下查找U盘 然后把硬盘的某个文件COPY到U盘里.........做好的BAT文件放到IMG里面去 然后用GRUB4DOS启动img.运行自作的BAT会提示. Required Parameter missing
缺少必要的参数 ?把bat用软件转换成exe 也是同样的问题..请问这是怎么回事呢???? 附批处理如下...
set UDrv=
set PeFlag=r3m1
rem 找PeFlag文件就代表找到U盘
if exist z:\%PeFlag% set UDrv=z:
IF not "%UDrv%"=="" GOTO ufind
if exist y:\%PeFlag% set UDrv=y:
IF not "%UDrv%"=="" GOTO ufind
if exist x:\%PeFlag% set UDrv=x:
IF not "%UDrv%"=="" GOTO ufind
if exist w:\%PeFlag% set UDrv=w:
IF not "%UDrv%"=="" GOTO ufind
if exist v:\%PeFlag% set UDrv=v:
IF not "%UDrv%"=="" GOTO ufind
if exist u:\%PeFlag% set UDrv=u:
IF not "%UDrv%"=="" GOTO ufind
if exist t:\%PeFlag% set UDrv=t:
IF not "%UDrv%"=="" GOTO ufind
if exist s:\%PeFlag% set UDrv=s:
IF not "%UDrv%"=="" GOTO ufind
if exist r:\%PeFlag% set UDrv=r:
IF not "%UDrv%"=="" GOTO ufind
if exist q:\%PeFlag% set UDrv=q:
IF not "%UDrv%"=="" GOTO ufind
if exist p:\%PeFlag% set UDrv=p:
IF not "%UDrv%"=="" GOTO ufind
if exist o:\%PeFlag% set UDrv=o:
IF not "%UDrv%"=="" GOTO ufind
if exist n:\%PeFlag% set UDrv=n:
IF not "%UDrv%"=="" GOTO ufind
if exist m:\%PeFlag% set UDrv=m:
IF not "%UDrv%"=="" GOTO ufind
if exist l:\%PeFlag% set UDrv=l:
IF not "%UDrv%"=="" GOTO ufind
if exist k:\%PeFlag% set UDrv=k:
IF not "%UDrv%"=="" GOTO ufind
if exist j:\%PeFlag% set UDrv=j:
IF not "%UDrv%"=="" GOTO ufind
if exist i:\%PeFlag% set UDrv=i:
IF not "%UDrv%"=="" GOTO ufind
if exist h:\%PeFlag% set UDrv=h:
IF not "%UDrv%"=="" GOTO ufind
if exist g:\%PeFlag% set UDrv=g:
IF not "%UDrv%"=="" GOTO ufind
if exist f:\%PeFlag% set UDrv=f:
IF not "%UDrv%"=="" GOTO ufind
if exist e:\%PeFlag% set UDrv=e:
IF not "%UDrv%"=="" GOTO ufind
if exist d:\%PeFlag% set UDrv=d:
IF not "%UDrv%"=="" GOTO ufind
if exist c:\%PeFlag% set UDrv=c:
IF not "%UDrv%"=="" GOTO ufind
if exist b:\%PeFlag% set UDrv=b:
IF not "%UDrv%"=="" GOTO ufind
if exist a:\%PeFlag% set UDrv=a:
IF not "%UDrv%"=="" GOTO ufind
:ufind
copy r3memid.log %uRrv%\r3m1
2#
发表于 2010-7-23 10:52:00 | 只看该作者
copy r3memid.log %uRrv%\r3m1
回复

使用道具 举报

3#
 楼主| 发表于 2010-7-27 11:10:13 | 只看该作者

回复 #2 laozhao 的帖子

copy r3memid.log %uRrv%\r3m1   %uRrv% 出错了吗?。。
回复

使用道具 举报

4#
发表于 2010-7-28 18:57:26 | 只看该作者
u盘原来有r3m1吗?复制过去为何不加y参数?

写的好长啊,这样写我不太懂。我建议你这样试试:
set UDrv=
for %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist %%i:\r3m1 set UDrv=%%i
if [%UDrv%]==[] goto nfind
:ufind
copy /y r3memid.log %uRrv%:\r3m1
goto exit
:nfind
echo Can not find u
:exit
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2024-10-1 23:30

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表