根据当前日期创建Windows 2003快捷方式或MKLINK?

时间:2011-05-09 14:25:46

标签: windows symlink shortcut mklink

我需要在将别名的prod服务器上创建一个符号链接/快捷方式:

agent_ivr_general_info.CURRENT

agent_ivr_general_info.[todays date].log

因为我每天都有滚动日志:

agent_ivr_general_info.2011-04-28.log

我想打开1 LINK才能进入CURRENT。

1 个答案:

答案 0 :(得分:1)

嗯......我想有一种方法是使用Sysinternals' JUNCTION.EXE和每天午夜后运行的预定任务,并使用以下内容更改链接:

cd TARGET_DIRECTORY
:: get date -- this only works for default US date, YMMV
set day=%DATE:~7,2%
set month=%DATE:~4,2%
set year=%DATE:~-4%
:: set %today% formatted as YYYY-MM-DD
set today=%year%-%month%-%day%
:: delete old link
junction -d CURRENT
:: create new one
junction -c CURRENT .\%today%