Not getting output for stdout or stderr on windows

Describe the problem/error/question

I’m trying to get the output when running any external programs via cli in windows command. So I used Execute Command node to execute the commands but it always give me empty stdout. In version 1.xx I would be able to see stdout output but with version 2.xx I don’t see them anymore. I also tried redirecting the output to a txt file but the txt file would still be empty inside. Running the command locally works but running it inside n8n doesn’t give stdout output

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:2.29.9
  • Database (default: SQLite):default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):default
  • Running n8n via (Docker, npm, n8n cloud, desktop app):npm
  • Operating system:Windows Server 2022

Hi @Ruriko

To verify that stdout is actually working, remove the file redirections and the cd command. Use the absolute path to the executable. This eliminates the possibility of cd failing or the output being hidden in a file.

Try this command in your node:

"C:\Users\Administrator\Desktop\Tools\MediaInfo_CLI_26.05_Windows_x64\mediainfo.exe" "C:\Users\Administrator\Desktop\Anime\Upload\[Gecko]..." 2>&1

If the command above still returns empty stdout, the error is likely hidden in stderr. You can force Windows to merge the error stream into the output stream by adding 2>&1 to the end of your command.

Modified Command:

"C:\Users\Administrator\Desktop\Tools\MediaInfo_CLI_26.05_Windows_x64\mediainfo.exe" "C:\Users\Administrator\Desktop\Anime\Upload\[Gecko]..." 2>&1

Since you are running on Windows Server 2022​, check which user is running the n8n process.

  • If n8n is running as a Service or under a different user than “Administrator”, it will not have permission to write to C:\Users\Administrator\Desktop\....
  • Solution: Move your tools and output folders to a root-level directory like C:\n8n-tools\ and grant “Full Control” to the Everyone group or the specific user running n8n.

I tried both commands and still return empty output. There are no other users on this server and n8n is not running as a service. I tried moving tools to a root level and that still gives empty output

Please perform these three tests in order. They are designed to isolate exactly where the “silence” is coming from.

Replace your entire command with this:

echo Hello from n8n
  • If this is empty: The issue is a fundamental communication failure between n8n and cmd.exe on your Server 2022 instance.
  • If this works: The Execute Command node is functioning, and the issue is specific to how external .exe files are being handled.

Run this command to list the files in your tools directory:

dir "C:\n8n-tools"

(Replace C:\n8n-tools with the actual root path you moved the tools to).

  • If this is empty: n8n is unable to spawn a shell process that has access to the filesystem, despite the folder being at the root.
  • If this works: The shell is working perfectly, and we are dealing with an application-level failure.

Run your MediaInfo command again, but add 2>&1 at the very end. This forces Windows to merge the Error stream into the Output stream.

Use exactly this format:

"C:\n8n-tools\MediaInfo_CLI_26.05_Windows_x64\mediainfo.exe" "C:\n8n-tools\test_file.mkv" 2>&1

(Ensure the paths are correct for your new root location).

Let me know the results

both of these give results

but this gives empty stdout/stderr

What about this?

""C:\n8n-tools\MediaInfo_CLI_26.05_Windows_x64\mediainfo.exe" "C:\n8n-tools\test_file.mkv""

doesn’t work using 2x double quotes won’t recognized as a command

'""C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" "test.mkv""' is not recognized as an internal or external command, operable program or batch file.

Please try this exact command.

"C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" "C:\Users\Administrator\Desktop\Anime\Upload\[Gecko] Muzik Tiger In the Forest [2025, TVER.WEB-DL 1080P]\[Gecko] Muzik Tiger In the Forest - S01E01 [TVER.WEB-DL 1080P AVC, AAC][D41B8A37].mkv"

If the output is still empty, it means MediaInfo is crashing before it can print anything. To see the “hidden” crash report, add 2>&1 to the end. This forces errors to show up in the output:

"C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" "C:\Users\Administrator\Desktop\Anime\Upload\[Gecko] Muzik Tiger In the Forest [2025, TVER.WEB-DL 1080P]\[Gecko] Muzik Tiger In the Forest - S01E01 [TVER.WEB-DL 1080P AVC, AAC][D41B8A37].mkv" 2>&1

Since you’re already on the CLI build and even the file redirect comes out empty, the command is definitely running — MediaInfo itself is producing nothing. Two things that haven’t been checked yet in this thread:

1. Look at the exitCode field in the Execute Command node’s output (it’s returned alongside stdout/stderr). That one number splits the problem in half: 0 means MediaInfo ran “successfully” and genuinely printed nothing, non-zero means it’s failing before producing output.

2. Your test file lives on C:\Users\Administrator\Desktop. This would explain the 1.x → 2.x difference: if your n8n 2.x is started differently than 1.x was (different user account, a service, a scheduled task, a different terminal session), the process may simply not be able to read another account’s Desktop folder — and MediaInfo is quiet about unreadable input files. Quick test: copy the video into C:\n8n-tools\ (which you already know n8n can reach, since dir worked there) and run MediaInfo against that copy.

And a 30-second isolation test that needs no input file at all:

"C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" --Version

run inside the Execute Command node. If the version string comes back, the binary and the stdout plumbing are fine and the problem is access to the input file (point 2). If even --Version is empty inside n8n while it prints in your own cmd window, then it’s the process context n8n runs under, not the file.

One more escape hatch worth knowing: MediaInfo can write its report directly to a file itself, bypassing stdout entirely:

"C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" --Output=JSON --LogFile=C:\n8n-tools\report.json "C:\n8n-tools\your_video.mkv"

If report.json gets content while stdout stays empty, you’ve isolated it to stdout capture; if it’s empty too, MediaInfo never read the file. (--Output=JSON also saves you parsing the text layout later.)

The exit code is 0 while stdout is empty. I didn’t know Mediainfo had built-in logging feature and that did what I wanted saving the output to a file. Pretty much "C:\MediaInfo_CLI_26.05_Windows_x64\MediaInfo.exe" --Output=JSON --LogFile=C:\n8n-tools\report.json "C:\n8n-tools\your_video.mkv" did that job just stdout was still empty but as long it saved to a json file I can later parse it.

Glad the --LogFile route got you unblocked, and thanks for closing the loop with the exact results — “exitCode 0 but stdout still empty” is a gold detail for the next person who lands here. Since echo and dir work but an external .exe stays silent even on success, this does look like a 2.x change in how Execute Command captures child-process output on Windows — might be worth filing as a bug report so it gets fixed upstream. Happy automating!