标题: [讨论]如何用if命令做个提出更新游戏的批处理文件
[打印本页]
作者: wangzhegulai
时间: 2005-3-19 00:00
标题: [讨论]如何用if命令做个提出更新游戏的批处理文件
最近想做个以时间为依据的(例如:3.18)if判断批处理文件,判断更新文件日期是否为(3.18);是,就复制到一文件夹中(例d:\computer\),否,就不用复制了,这样更新文件就提出来了,做个游戏自解压包,升级游戏简单了.但不知道如何写请高手帮一下了,谢谢了.
如各位高手有什么好的方法或建议,可给我发个邮件:wangzhegulai@163.com
在次感谢你能浏览我的贴子.谢谢你的回复和支持.
作者: chenhui530
时间: 2005-3-20 00:00
你的3.18是指文件建立日期还是文件名
作者: JonePeng
时间: 2005-3-20 00:00
可以用date和find来寻找当天是否3月18日。在纯DOS或Win9x下:
Quote: |
@echo off
kpush 13
date|find "3-18" >nul
if errorlevel 1 goto end
echo Today is March 18, updating...
copy xxxx d:\computer >nul
echo Update completed.
:end |
|
注:kpush是MSDOS 7.1启动盘里的模拟键盘输入的小程序。
在Win2000/XP下写法略有不同:
Quote: |
@echo off
date /t|find "3-18" >nul
if errorlevel 1 goto end
echo Today is March 18, updating...
copy xxxx d:\computer >nul
echo Update completed.
:end |
|
[此贴子已经被作者于2005-3-20 19:31:20编辑过]