中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟
中国DOS联盟论坛
现在时间是 2026-09-14 15:59
47,812 主题排行 / 349,917 发帖 / 今日 0 篇 / 48,268 会员排行
DOS批处理 & 脚本技术(批处理室) » [求助]为什么同样的代码move换成copy就失灵了?
可打印版本  2,592 / 0
第1楼 youxianwei 发表于 2022-11-27 08:00
新手上路 发帖 2 积分 1
[求助]为什么同样的代码move换成copy就失灵了?
20221126为什么同样的代码move换成copy就失灵了?!?!?!?!?
链接:https://pan.baidu.com/s/12aO97Q_LzjxzpDPrvYqTqA?pwd=6666
提取码:6666
█████████████████████████████████████████████████成功!!!!
set /p "保留格式名= 请输入某个不想分拣的文件格式符【语法必须为.abc】!!!:"
setlocal enabledelayedexpansion
mkdir "非"%保留格式名%
for /f "delims=" %%a in ('dir /b /s /a-d') do (
if not "%%~nxa"=="%~nx0" ( rem 自己除外
if /i not %%~xa ==%保留格式名% ( rem 某格式除外 doc,xls,ppt
if /i not %%~xa ==%保留格式名%x ( rem 某格式除外 docx,xlsx,pptx
【move】 "%%~a" ./"非"%保留格式名%
))))
endlocal


█████████████████████████████████████████████████失败????
set /p "保留格式名= 请输入某个不想分拣的文件格式符【语法必须为.abc】!!!:"
setlocal enabledelayedexpansion
mkdir "非"%保留格式名%
for /f "delims=" %%a in ('dir /b /s /a-d') do (
if not "%%~nxa"=="%~nx0" ( rem 自己除外
if /i not %%~xa ==%保留格式名% ( rem 某格式除外 doc,xls,ppt
if /i not %%~xa ==%保留格式名%x ( rem 某格式除外 docx,xlsx,pptx
【copy】 "%%~a" ./"非"%保留格式名%
))))
endlocal

[ Last edited by youxianwei on 2022-11-27 at 08:21 ]
[ 联系联盟系统管理团队 - 中国DOS联盟 - 标准版 ]
Sponsored by ifanr Inc | © 2001–2023