Why does the "dos" command not work as expected when using "cd" to switch directories?
显示 更早的评论
The "dos" command does not work as expected for switching directories with the "cd" command.
>> [status, cmdout] = dos('cd C:\')
cmdout =
0×0 empty char array
However, the "dos" command works for different operations like "dir" fine.
>> [status, cmdout] = dos('dir')
cmdout =
' Volume in drive C is Windows
Volume Serial Number is 6405-C0AD
Directory of C:\Users\..\...\...\...
12/26/2024 04:35 PM <DIR> .
12/30/2024 02:49 PM <DIR> ..
Why does the "dos" command work with "dir" but not with "cd"?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!