批处理脚本文件名 [英] Batch script file name

查看:219
本文介绍了批处理脚本文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是下面的批处理脚本,从当前文件夹中的文件复制到指定的位置。

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.


  1. 我不能够选择一个特定的文件并运行脚本,例如如果文件夹得到更多(EPS)文件是将所有文件复制到该位置。

  1. 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

这篇关于批处理脚本文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆