批量记录帮助

发布于 2024-10-10 02:19:56 字数 154 浏览 0 评论 0原文

好吧,我有一个在批处理的帮助下运行的程序。它是一个由 EXE 文件运行的 PHP 脚本。 如何才能在程序运行时将输出自动发送到文件(例如 log.txt),并同时将输出显示在屏幕上?

我尝试了类似program.exe>>的东西log.txt,但屏幕上没有显示输出。

Well, I have this program that I run with the help of batch. Its a PHP script that is ran by an EXE file.
How can I have it that while the program is running, the output is automatically sent to a file, say log.txt, and have the output simultaneously shown on screen?

I tried something like program.exe >> log.txt, but that didnt show output on the screen.

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

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

发布评论

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

评论(2

來不及說愛妳 2024-10-17 02:19:56

如果您只想使用 Windows 命令来执行此操作,您可能应该尝试这样的操作:

program.exe > %temp%\temp.log
type %temp%\temp.log
type >>  log.txt
@del %temp%\temp.log /S /Q

Windows 命令中没有尾部等效项。

If you want to do it only with windows commands may be you should try something like this:

program.exe > %temp%\temp.log
type %temp%\temp.log
type >>  log.txt
@del %temp%\temp.log /S /Q

there is no tail equivalent in windows commands.

冰雪梦之恋 2024-10-17 02:19:56

“在屏幕上显示输出”是指更新已打开的屏幕/控制台窗口上的文件内容。

如果是,您可以使用以下命令

tail -f log.txt

请注意,“tail”在 Windows 基本安装中不可用,但您可以下载它(免费)。寻找适用于 Windows 的 unixUtils。

By 'show output on the screen' do you mean updating the file contents on an already opened screen/console window.

If yes, you can use the following command

tail -f log.txt

Please note that 'tail' is not available with base installation of windows, but you can download it (free). look for unixUtils for windows.

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