Change test.cmd to the following:
@echo off for /f "tokens=*" %%a in ('"%~dp0\echoit.cmd" Hello World') do ( echo %%a )
You need to set the entire command, minus arguments, in quotation marks. The Windows command line treats a collection of words as a single command when the entire collection is quoted, so you must exclude the Hello World arguments. If you included this in quotation marks, Windows would treat this as part of the command, not as arguments.
source share