I have a *.bat file in variety folders which renames certain files number,project name and initials are included in the filename.I would be what /.bat file ".I would be the exercise filmingproject>中的变量= = = =
获取 bat 文件的文件名
从文件名中提取 3 个文本字符串(使用分隔符,如(& lt;,)
将 3 个文本字符串存储为参数(NO,PROJECT,INITIAL)
现有代码的其余部分应该重命名文件夹中的文件
谢谢
现有代码如下:
cls
echo off
pushd "%~p0" 2> nul
pushd "\\%~p0" 2> nul
echo
attrib -r *.* /s
set /p no= Enter Project Reference in style XY00.000:
set /p project= Enter Project name (without any underscores):
set /p initial= Enter your Initials:
for /f "tokens=1* delims=(" %%i in ('dir /b *.xlsm') do ren "%%i(%%j" "%%i(%no% %project%_%initial%).xlsm"
for /f "tokens=1,2* delims=()" %%i in ('dir /b *.docm') do ren "%%i(%%j)%%k" "%%i(%no% %project%_%initial%)%%k"
我将用户输入替换为:
set infovariable=%~n0
,它将 bat 文件的文件名作为变量,并在以后使用它与它重命名适当的文件。bat 文件被命名为正是我想要的文本。作业完成!
本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处
评论列表(55条)