[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
@echo off
echo 请先将*.txt重命名为1.txt并和批处理在同一目录下,文档里的文件名不能在同一行并要有后缀名
set /p lj=请输入要拷贝到的路径(X:\文件夹):
md "%lj%"
for /f "skip=1" %%i in ('^(wmic logicaldisk where drivetype^='3' get name^)') do (echo 正在%%i\中搜索......
  echo %%i|findstr ":">nul&&(
    for %%j in (1.txt) do (
      for /f "delims=" %%a in (%%j) do (
        for /f "delims=" %%b in ('dir /a /b /s "%%i\%%a"') do (
          for /f "tokens=1-3" %%i in ('attrib "%%b"') do (
            echo %%i|findstr /i "\<s\> \<h\> \<sh\>">nul&&(attrib -s -h "%%b"&set abc==)
            echo %%j|findstr /i "\<s\> \<h\> \<sh\>">nul&&(attrib -s -h "%%b"&set abc==)
            echo %%k|findstr /i "\<s\> \<h\> \<sh\>">nul&&(attrib -s -h "%%b"&set abc==)
          )
          if %%j equ 1.txt copy "%%b" "%lj%"
   
          if defined abc (attrib +s +h "%%b"&set abc=)
        )
      )
    )
  )
)
pause


for /f "skip=1" %%i in ('^(wmic logicaldisk where drivetype^='3' get name^)')改为for  %%i in (c d e f g)后用不了,还要修改哪里吗,请指教下,谢谢

TOP

返回列表