如何创建一个名称的文件夹作为批处理(.bat)文件当前日期 [英] How to create a folder with name as current date in batch (.bat) files

查看:901
本文介绍了如何创建一个名称的文件夹作为批处理(.bat)文件当前日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道很多关于.bat文件语法窗口。我简单的要求是在特定的位置,名称,当前日期创建一个文件夹。我试着在谷歌搜索这一点,但没有得到任何好的选择。有没有办法做到这一点?

I don't know much about windows .bat file syntax. My simple requirement is to create a folder at a specific location with name as current date. I tried searching this on google but didn't get any good option. Is there any way to do this?

推荐答案

试试这个(反引号的bash的等效):

Try this (an equivalent of bash backquotes):

for /f "tokens=1* delims=" %%a in ('date /T') do set datestr=%%a
mkdir %datestr%

有关详细信息,请参见 http://ss64.com/nt/for_cmd.html

For further information, see http://ss64.com/nt/for_cmd.html

这篇关于如何创建一个名称的文件夹作为批处理(.bat)文件当前日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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