維尼的蜂巢

RealTime??!! It’s amazing!!!!

批次檔Tip 八月 29, 2008

Filed under: VC++/C++/C — kevinlin @ 6:59 下午

手動備份log檔案的bat檔案

這樣可以在檔名上加上時間日期

REM 取得日期
FOR /F “tokens=1-4 delims=/ " %%a IN (“%date%") DO (
SET _MyDate=%%a%%b%%c%%d
)
REM 取得時間
FOR /F “tokens=1-4 delims=:." %%a IN (“%time%") DO (
SET _MyTime=%%a%%b%%c%%d
)

copy .\1\game.log .\紀錄檔\log_%_MyDate%_%_MyTime%(1).log
copy .\2\game.log .\紀錄檔\log_%_MyDate%_%_MyTime%(2).log
copy .\3\game.log .\紀錄檔\log_%_MyDate%_%_MyTime%(3).log
copy .\4\game.log .\紀錄檔\log_%_MyDate%_%_MyTime%(4).log

 

One Response to “批次檔Tip”

  1. 餅乾 Says:

    你太遜了…我十萬年前就有這種 script 了😄


發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s