|
|
发表于 2010-3-23 23:23:20
|
显示全部楼层
@echo off&setlocal enabledelayedexpansion&cd /d %~dp0&set dr=c d e f g h i j k l
SET/P VC=请输入要操作的目录名
:k_
SET/P VK=把要转存的目标文件侠拖放到本窗口
if defind VC goto %0
if defind VK goto k_
if exist 0.txt del 0.txt /q/y
for %%a in (%dr%) do IF /I EXIST %%a:\%VC% dir /a/b/s "%%a:\%VC%">>0.txt
:: 注意: copy "" "" 前面对引号要省略 for 过的变量, copy 下不能引用对引号, 否则提示找不到文件, 这是我血的教训, 曾经就是这对引号, 害我把批处理检查了N片
::鼠标双击我去六楼(就是犯了这个错误)
for /f "delims=*" %%i in (0.txt) do set name=%%~pi&SET "name=!name:%VC%=%VK%!"© %%i "!name!"
for /f %%c in ('dir /a/s/b "%VK%"') do (
if /i exist "%%~xc"==".txt" ren %%~i "%%~dpinotes.txt"
if /i exist "%%~xc"==".jpg" ren %%~i "%%~dpilogo.jpg"
)
[ 本帖最后由 x9tiancmd 于 2010-3-23 23:47 编辑 ] |
|