新增:支持将日志写入到文件#14
Open
pooneyy wants to merge 3 commits into
Open
Conversation
通过运行 run.bat 间接调用脚本,保证日志文件始终和脚本在同一路径下
Contributor
其实可以在计划任务的 |
Author
嗐,写都写完了 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
使用任务计划程序(taskschd.msc)可设置定时运行脚本,但是日志不可见。通过将日志输出到文件,可帮助了解脚本运行情况。
如果直接使用任务计划程序调用脚本,那么日志文件将会出现在 “C:\Windows\System32” 文件夹下,如果你想让日志文件和脚本在同一个目录下,请在同目录下创建 .bat 文件:
通过 .bat 程序间接调用脚本,日志文件将始终会和脚本在同一个目录下。