弹窗代码bat:在模板bat文件之后命名文件-使用CMD代码

关于弹窗代码bat的问题,在template bat中经常遇到, 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 filming中的变量

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"
0

我将用户输入替换为:

set infovariable=%~n0

,它将 bat 文件的文件名作为变量,并在以后使用它与它重命名适当的文件。bat 文件被命名为正是我想要的文本。作业完成!

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(197)
Caprari水泵:带水泵的ArduinoNano-启动时停止泵运行
上一篇
Extremly:WinFormsWebView2cpu负载极高
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(55条)