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
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.
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.
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
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.
"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:
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:
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!