帮我看看批量重命名的BAT
bat吧
全部回复
仅看楼主
level 4
榄樱C5 楼主
@echo off
for /f "delims=" %%i in ('dir /ad /b /s "C:\Documents and Settings\Administrator\桌面\Music"') do (ren %%i %%i.mp3)
pause
2011年10月05日 12点10分 1
level 4
榄樱C5 楼主
这个文件夹的文件是tmp格式的,这个语句的作用是直接在原名上加.mp3,可是语句运行后还是没有用。还有个问题就是怎么样把tmp替换为mp3。。要用到字符截取什么的吧。。。
2011年10月05日 12点10分 2
level 13
路径含有空格
2011年10月05日 12点10分 3
level 4
榄樱C5 楼主
空格用英文双引号括起来了。。
2011年10月05日 12点10分 4
level 13
set "a=%%i"
echo.%a:~0,-4%
2011年10月05日 12点10分 5
level 13
set "a=123456789.tmp"
echo.%a:~0,-4%
2011年10月05日 12点10分 6
level 13
DIR /AD是查看目录
2011年10月05日 12点10分 7
level 4
榄樱C5 楼主
3Q,没问题了,呵呵,基础不扎实
2011年10月05日 12点10分 8
level 4
榄樱C5 楼主
把ren 改为move就行了,ren 好像只能对当前盘符的东西操作
2011年10月05日 12点10分 9
level 4
榄樱C5 楼主
set "a=123456789.tmp" 为什么要用双引号?
2011年10月05日 12点10分 10
level 13
不加也行
2011年10月05日 12点10分 11
level 4
榄樱C5 楼主
我把代码改成这样@echo off
for /f "delims=" %%i in ('dir /b /s "C:\Documents and Settings\Administrator\桌面\Music"') do (
set p=%%i
move %%i %p:~0,-4%.mp3
)
pause
怎么显示 ECHO 处于关闭状态。
2011年10月05日 13点10分 12
level 4
榄樱C5 楼主
for 里的变量i,可以用自己定义的变量吗?可以把for里的变量赋值给自己定义变量吗?怎么弄?
2011年10月05日 13点10分 13
level 13
这个在FOR里赋值后不能用%%做变量,这涉及到变量延迟,手机不方便,明天说吧,
2011年10月05日 13点10分 14
1