how can I open the folder from desktop using matlab code?
83 次查看(过去 30 天)
显示 更早的评论
I am doing a project in that i have to open the folder using Matlab code. how can I open the folder from desktop using matlab code?
1 个评论
Jan
2013-9-30
It depends on what "open" and "the folder from desktop" exactly means here. Both terms could mean a variety of different things, so please add more information by appending it to the original question by editing. I've seen too many important information hidden in comments or pseudo-answers, where the readers do not expect it.
回答(3 个)
Image Analyst
2013-9-30
编辑:Image Analyst
2013-9-30
If you're using windows, you can do
winopen(folderName);
where folderName is a string, for example 'D:\MyData'. It will bring up Windows Explorer open to the folder that you specified.
0 个评论
Ryan Chester
2018-1-12
This will give you the path to the desktop folder, and open it so you can select a file from it.
desktop=winqueryreg('HKEY_CURRENT_USER', 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', 'Desktop');
[FileName,PathName,FilterIndex] = uigetfile({'*'},'Here, the desktop is "open"',desktop);
0 个评论
Simon
2013-9-30
Hi!
You get the users directory in Windows with
[~, userdir] = system('echo %USERPROFILE%')
The desktop folder is in this folder.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!