How can I get the short path for a Windows long path using MATLAB 7.8 (R2009a)?
조회 수: 15 (최근 30일)
이전 댓글 표시
I would like to be able to get the short path in 8.3 format for a certain path, for example:
"C:\Program Files" should be transformed to "C:\Progra~1"
채택된 답변
MathWorks Support Team
2009년 8월 27일
The ability to transform long paths to short paths is not available in MATLAB.
To work around this issue, if you have the Real Time Workshop (RTW), you can use a built-in function:
RTW.transformPaths('C:\Program Files')
An alternative that does not require the RTW uses the Windows File System Object:
function shortPath = getshortpath(longPath)
fs = actxserver('Scripting.FileSystemObject');
shortPath = fs.GetFolder(longPath).ShortPath;
fs.delete;
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!