我想通过 bat 文件在 notepad++ 中打开一个文本文档,我已经实现了。
这是我用来打开文件的命令。 %SystemRoot%\explorer.exe "D:\文件路径\file.log"
其次,由于文件正在通过某些外部手段更新,我希望定期刷新它。我需要一个 bat 文件命令来执行此操作。
答案1
要在 notepad++ 中自动打开文件,只需将其传递给 notepad++:
"C:\Program Files (x86)\Notepad++\notepad++.exe" "D:\path of file\file.log"
为了让它自动更新,这个答案已经在 SU 中回答了:如何在 Notepad++ 中自动重新加载修改过的文件
任何一个Settings -> Preferences -> MISC -> Update silently
或者
There is a nice plugin called Document monitor (Can be found and installed from the Plugins => Plugin Manager => show Plugin Manager menu),
It updates the opened files every 3 seconds. Together with the option to "scroll to last line after update", it will have the ability to "tail" a log file as wanted.
After the plugin installation don't forget to activate it by clicking:
Plugins => Document monitor => start to monitor