MATLAB: Path containing a trailing ampersand doesn’t work in system () call

MATLABsystemtrailing ampersand

Hi Folks,
I have to open the following *.exe, but the trailing ampersand in the default path interrupts my system call.
Do you know a solution without changing the default path?
command = ['C:\Program Files (x86)\W&T USB Redirector\Usbcontrol.exe /ADD 10.17.253.13:32032 2.4']
[status, cmdout]=system(command, '-echo');

Best Answer

I do not see the "trailing ampersand". Do you mean the one in "W&T"?
Why do you assume, that this is a problem of the &? Do you get a corresponding error message? If so, please share this important detail. But actually I assume, that the spaces in the path are problem, because you did not enclose the path in double quotes. Try this:
command = ['"C:\Program Files (x86)\W&T USB Redirector\Usbcontrol.exe" /ADD 10.17.253.13:32032 2.4']
% ^ ^
[status, cmdout]=system(command, '-echo');