移动文件并包含日期 [英] Move files and include date

查看:67
本文介绍了移动文件并包含日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


移动后或移动过程中我可以在文件名中包含日期?


我尝试使用这个命令:

移动文件* .txt c:\files \files * .txt%date %% time:~0.8%

但不起作用。


谢谢!




Caso a resposta tenha lhe atendido,青睐marcar como resposta。 Assimospróximosqueestiverem com aduvidaaceámenilmentesanada eseexível,marcar como util,casopaplicável。   Matheus Sanches

解决方案


但不是工作。


Matheus Sanches


我喜欢报道"它不起作用"的帖子。这留下了很大的猜测空间!为什么不发布您看到的实际错误消息?


作为猜测,您的日期代码包含一些不可接受的字符,例如斜杠/或冒号:。它们是什么我不知道 - 这取决于您的区域格式。我们假设您的日期有斜线,例如像这样:


2014年1月16日


如果是这样,那么你必须用一个可容许的字符替换它们,例如:短划线:


设置MyDate =%date:/ = - %


然后必须在代码中使用%MyDate%而不是%Date%


Hi,

Who I can include date in file name after moved or in move process with Batch?

I try use this command:

move files*.txt c:\files\files*.txt%date%%time:~0,8%

But does not working.

Thanks !


Caso a resposta tenha lhe atendido, favor marcar como resposta. Assim os próximos que estiverem com a duvida será facilmente sanada e se possível, marcar como util, caso aplicável. Matheus Sanches

解决方案

But does not working.

Matheus Sanches

I love posts that report "It is not working". This leaves so much room for guessing! Why not post the actual error message you see?

As a guess, your date code includes some inadmissible characters, e.g. slashes / or colons :. What they are I do not know - it depends on your regional format. Let's assume your date has slashes, e.g. like so:

01/16/2014

If so then you must replace them by an admissible character, e.g. a dash:

set MyDate=%date:/=-%

You must then use %MyDate% in your code instead of %Date%.


这篇关于移动文件并包含日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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