首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > windows >

哪位高手知道在bat中如何提取系统时间

2012-04-10 
谁知道在bat中怎么提取系统时间在bat中提取系统时间后进行判断,如果是1日,把文件拷贝到文件名为1的文件夹

谁知道在bat中怎么提取系统时间
在bat中提取系统时间后进行判断,如果是1日,把文件拷贝到文件名为1的文件夹里;如果是10日,把文件拷贝到文件名为10的文件夹里;如果是20日,把文件拷贝到文件名为20的文件夹里

[解决办法]

BatchFile code
@echo offrem 假设系统日期格式为:2009-06-14 星期日set day=1%date:~5,2%set /a day%%=100copy /y "C:\test\a.txt" "C:\test\%day%"
[解决办法]
探讨
BatchFile code
@echo off
rem 假设系统日期格式为:2009-06-14 星期日
set day=1%date:~5,2%
set /a day%%=100
copy /y "C:\test\a.txt" "C:\test\%day%"



[解决办法]
time /t
[解决办法]
rem for DOS/NT
echo exit|%comspec% /k prompt $T$_ | find ":" > time.txt
[解决办法]
@echo on
rem supoose the current date is 2009-6-15
rem this bat file will make a file at c:\ as 15 and copy the c:\file into file
ren if you don't want to get out the command you can change the code as @echo off
date /t
set day=1%date:~9,2% 
@echo make file as date time .for example 15
md c:\%day%
echo the "c:\files " means what file you want to copy to the datetime file
echo copy /y "c:\file" "c:\%day%"
[解决办法]
date
time/t

热点排行