MATLAB: Does the system tree command give me an error on 32-bit MATLAB on a 64-bit platform

MATLAB

Executing the DOS command "tree" on 32-bit MATLAB on 64-bit Windows machine, gives me an error. Both the following commands below result in the same error.
status=dos('tree')
status=system('tree')
The error message returned is:
'tree' is not recognized as an internal or external command, operable program or batch file.
This command however works fine with
a) 64-bit MATLAB on 64-bit machine.
b) 32-bit MATLAB on 32-bit machine
This issue is only specific to the 'tree' command. Dos commands such as dir do not exhibit this issue.

Best Answer

This behavior is due to the levels of 32bit compatability in a Windows 64-bit PC.
To work around this behavior, perform the following:
1. Execute
copy c:\windows\system32\cmd.exe c:\temp
2. Launch matlab (the 32-bit version on Windows XP 64).
3. Execute
!C:\TEMP\CMD /c C:\Windows\system32\tree.com