问题描述
我使用的是下面的批处理脚本,从当前文件夹中的文件复制到指定的位置。
I am using the below batch script to copy the files from current folder to the specified location.
@echo off
echo copying files to destination
copy *.eps* \\10.10.14.13\adman\in\displ )
我现在面临两个问题在上面的脚本。
I am facing 2 problems in the above script.
-
我不能够选择一个特定的文件并运行脚本,例如如果文件夹得到更多(EPS)文件是将所有文件复制到该位置。
I am not able to select a particular file and run the script, for e.g if the folder got more (eps) files it copies all the files to the location.
我想在每个复制文件的末尾插入我的用户的登录名。
I want to insert my user login name at the end of the each copied file.
我的文件名看起来像 F0#CGDBANG000947532#.EPS
,我想这样的 F0#CGDBANG000947532#username.eps
。
My file name look like F0#CGDBANG000947532#.eps
and I want like this F0#CGDBANG000947532#username.eps
.
推荐答案
最后,经过一番您的意见在这里和您的其他问题,我理解你的要求(我认为)。
finally, after some of your comments here and in your other question, I understood your request (I think).
@echo off
for %%i in (%*) do if /i "%%~xi"==".eps" copy "%%i" "\\10.10.14.13\adman\in\displ\%%~ni%username%.%%~xi"
pause
这篇关于批处理脚本文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!