无忧启动论坛

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

求助.如何在DOS下查找到U盘后.然后把系统文件copy到U盘

[复制链接]
跳转到指定楼层
1#
发表于 2010-7-21 05:18:40 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请教各位大虾..本人在使用一款DOS下的显卡维修.测试软件...用U盘grub4dos引导软件进去 运行 运行完成后会生成一个log文件.....
因为有时显卡是花屏或者黑屏 根本无法再DOS下面查看log文件..所以想做个批处理文件 dos下面查找到U盘 然后把LOG文件coyp到U盘
在其他机器查看...自动查找U盘已经做好 但是如何把文件COPY到U盘里去 盘符不知道如何定义 卡在那里 麻烦高手帮下忙.......

for /f "skip=1" %%i in ('wmic logicaldisk where "drivetype=2" get
caption') do fsutil fsinfo drivetype %%i
这个是查找U盘的..
2#
发表于 2010-7-21 07:02:15 | 只看该作者
你这也不是dos下阿,你这不是 xp下的cmd 么?
而且你这样 连A: 盘也找出来了,而且如果你的u盘量产成usb-hdd 模式,恐怕也找不到。

[ 本帖最后由 dos时代菜鸟 于 2010-7-21 07:05 编辑 ]
回复

使用道具 举报

3#
发表于 2010-7-21 08:59:09 | 只看该作者
我有个想法,你试下可行不?就是在U盘下建一个文件,最好是比较奇怪的文件(如:adsgerf5.sdf),然后查找这个文件来定位U盘.
回复

使用道具 举报

4#
 楼主| 发表于 2010-7-21 16:25:12 | 只看该作者
不怎么会用批处理唉 找到U盘后 怎么写 盘符 也没搞得好 郁闷了...
回复

使用道具 举报

5#
 楼主| 发表于 2010-7-23 01:34:58 | 只看该作者
文件作成功了
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

在WINDOWS下测试正常 怎么放到img里面 bat文件无法运行
提示requirde parameter missing 提示 缺少必要的参数 这是啥意思???
回复

使用道具 举报

6#
发表于 2010-7-23 14:13:09 | 只看该作者
  1. @echo off
  2. set UDrv=
  3. set str=c d e f g h i j k l m n o p q r s t u v w x y z
  4. for %%i in (%str%) do (
  5.    if exist %%i:\r3m1 (
  6.      set UDrv=%%i
  7.        GOTO ufind
  8. )
  9. )
  10. :ufind
  11. copy r3memid.log %UDrv%:\r3m1
复制代码
代码最后一句变量名错了

[ 本帖最后由 zjw767676 于 2010-7-23 14:25 编辑 ]
回复

使用道具 举报

7#
 楼主| 发表于 2010-7-27 11:13:42 | 只看该作者
谢谢zjw767676 兄弟的指教。
回复

使用道具 举报

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

本版积分规则

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

闽公网安备 35020302032614号

GMT+8, 2024-10-2 06:34

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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