The limitation of the Execute Target File Action is that lmhostid.exe is the executed command and the rest of the line (-ether >> hostid.txt) is treated as parameters. However, only -ether is intended as the parameter for the lmhostid.exe command. >> hostid.txt is intended to redirect the output of the lmhostid.exe -ether command to a text file. As a result, the Execute Target File Action fails to execute the command properly. Hence, the user should use an Execute Script/Batch File Action instead, because the Execute Script/Batch File Action runs the Script as a Linux shell script or Windows batch file, which results in the correct execution of the lmhostid.exe command with the -ether parameter with the separate redirection to the hostid.txt text file. In other words, the Execute Script/Batch File Action does not treat the entire line as a single command; the action executes the command as though the user ran the command from the command-line.
For more information about the Execute Target File Action, click here.