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

发布于 2024-11-06 07:00:33 字数 301 浏览 0 评论 0原文

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

agent_ivr_general_info.CURRENT

to

agent_ivr_general_info.[todays date].log

因为我每天的滚动日志 cush 为:

agent_ivr_general_info.2011-04-28.log

我只想打开 1 个链接即可到达当前状态。

I need to create a symlink/shortcut on the prod servers that will alias:

agent_ivr_general_info.CURRENT

to

agent_ivr_general_info.[todays date].log

because I have daily rolling logs cush as:

agent_ivr_general_info.2011-04-28.log

That I want to just open 1 LINK to get to CURRENT.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

酷炫老祖宗 2024-11-13 07:00:33

嗯...我想一种技术是使用 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%

Hmm... I suppose one technique would be to use Sysinternals' JUNCTION.EXE with a Scheduled Task that runs daily just after midnight, and uses something like the following to change the link:

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%
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文