使批处理文件创建一个文件夹与今天的日期,然后将文件从一个文件夹中移动到新创建的文件夹 [英] make batch file that creates a folder with today's date then moves files from a folder in to that newly created folder

查看:239
本文介绍了使批处理文件创建一个文件夹与今天的日期,然后将文件从一个文件夹中移动到新创建的文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要创建一个批处理文件,以今天的月份格式(例如080112)生成当天日期的文件夹。然后一旦创建,我需要将文件从一个文件夹中移动到它刚刚创建的文件夹。说实话我不知道如何创建一个批处理文件。

I need to make a batch file that will make a folder with today's date in month day year format (example 080112). Then once it's created i need to move files from a set folder in to the folder it just created. To be honest i don't know how to make a batch file.

推荐答案

FOR /f "tokens=2-4 delims=/ " %%i in ('DATE/T') do SET today_fname=%%i%%j%%k
cd c:\myfolder\%today_fname%
REM This creates a folder named 05242016 in c:\myfolder

这篇关于使批处理文件创建一个文件夹与今天的日期,然后将文件从一个文件夹中移动到新创建的文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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