- 帖子
- 7
- 积分
- 29
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2012-8-20
|
@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)后用不了,还要修改哪里吗,请指教下,谢谢 |
|