Microsoft MVP성태의 닷넷 이야기
Windows: 187. Windows - 도스 시절의 8.3 경로를 알아내는 방법 [링크 복사], [링크+제목 복사],
조회: 16142
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)

Windows - 도스 시절의 8.3 경로를 알아내는 방법

예전 도스 시절에는, 파일 및 디렉터리 이름이 8.3 형식으로 확장자를 제외한 파일명이 8자를 넘을 수 없었습니다. 실제로 아직도 윈도우는 하위 호환성을 위해 이런 이름 규칙을 적용하고 있는데요, dir 명령어의 /x 옵션으로 이를 확인할 수 있습니다.

C:\Users\kevin> dir "%ProgramFiles%" /X
 Volume in drive C has no label.
 Volume Serial Number is 1818-7042

 Directory of C:\Program Files

06/13/2020  06:37 PM    <DIR>                       .
06/13/2020  06:37 PM    <DIR>                       ..
10/29/2019  05:19 PM    <DIR>                       7-Zip
01/26/2020  11:21 PM    <DIR>                       AhnLab
12/07/2019  06:31 PM    <DIR>          COMMON~1     Common Files
10/04/2018  02:34 PM    <DIR>                       dotnet
06/13/2020  06:37 PM    <DIR>                       IIS
08/24/2017  11:59 PM    <DIR>          IISEXP~1     IIS Express
06/13/2020  05:58 PM    <DIR>          INTERN~1     Internet Explorer
08/24/2017  11:57 PM    <DIR>          MICROS~1.NET Microsoft ASP.NET Core Runtime Package Store
08/24/2017  11:20 PM    <DIR>          MICROS~1     Microsoft SQL Server
08/24/2017  11:16 PM    <DIR>          MICROS~3     Microsoft SQL Server Compact Edition
12/07/2019  06:14 PM    <DIR>                       ModifiableWindowsApps
...[생략]...

그런데, 재미있는 것은 위의 경로에서 ModifiableWindowsApps 디렉터리 이름은 분명히 8자를 넘고 있으면서도 8.3 형식의 이름이 없습니다. (이러한 예외가 어떻게 발생하는 것인지, 혹시 아시는 분은 덧글 부탁드립니다. ^^)




현재의 윈도우는 기본적으로 8.3 형식의 이름을 C 드라이브에 대해서만 생성하는 규칙을 가지고 있습니다. 따라서 같은 이름의 파일 또는 디렉터리를 생성해도 C와 D 드라이브의 출력이 다릅니다.

C:\temp> mkdir TestImages

C:\temp> dir /X
 Volume in drive C has no label.
 Volume Serial Number is C02C-196F

 Directory of C:\temp

2021-01-28  오전 08:02    <DIR>                       .
2021-01-28  오전 08:02    <DIR>                       ..
2021-01-28  오전 08:01    <DIR>          TESTIM~1     TestImages
...[생략]...

D:\temp> mkdir TestImages

D:\temp> dir /X
 Volume in drive D is New Volume
 Volume Serial Number is EED1-5978

 Directory of D:\temp

2021-01-28  오전 08:28    <DIR>                       .
2021-01-28  오전 08:28    <DIR>                       ..
2021-01-28  오전 08:28    <DIR>                       TestImages
...[생략]...

해당 드라이브가 8.3 형식의 이름 생성을 지원하는지는 fsutil 도구를 이용해 알 수 있습니다.

fsutil 8dot3name
; https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fsutil-8dot3name

D:\> fsutil 8dot3name query c:
The volume state is: 0 (8dot3 name creation is enabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is enabled on c:

D:\> fsutil 8dot3name query d:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 2 (Per volume setting - the default).

Based on the above settings, 8dot3 name creation is disabled on d:

따라서 D 드라이브에 대해서도 8.3 이름 생성을 원한다면 다음과 같이 실행하면 됩니다.

fsutil 8dot3name set d: 0




그런데, fsutil의 실행 결과를 보면 "registry state"라는 결과가 나옵니다. 이것은 NtfsDisable8dot3NameCreation 값을 의미하는데, 현재 Windows Server 2000에서의 문서에서만 확인할 수 있는 상태입니다.

NtfsDisable8dot3NameCreation
; https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc959352(v=technet.10)

경로: Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
이름: NtfsDisable8dot3NameCreation
형식: REG_DWORD
값:
    0: 모든 드라이브에 대해 8.3 이름 생성
    1: 모든 드라이브에 대해 8.3 이름 생성하지 않음
    2: (기본값) 볼륨마다 지정한 값 생성 (즉, fsutil로 지정한 값 사용)

(어느 버전부터인지는 알 수 없으나) 윈도우의 기본값이 2로 설정되어 있기 때문에 fsutil의 설정에 따른 "volume state"가 8.3 이름 생성을 좌우합니다.

만약, 이 값을 0으로 설정하고 재부팅을 하면 이후 모든 드라이브에 대해 8.3 이름 생성을 지원하고 이때의 fsutil 출력 결과는 다음과 같습니다.

C:\WINDOWS\system32> fsutil 8dot3name query d:
The volume state is: 1 (8dot3 name creation is disabled).
The registry state is: 0 (Enable 8dot3 name creation on all volumes).

Based on the above settings, 8dot3 name creation is enabled on d:

그리고, 이렇게 모든 드라이브의 설정에 영향을 끼치는 레지스트리 값이 설정되면 개별적인 드라이브에 대한 설정을 바꾸는 fsutil은 실행 시 오류가 발생합니다.

C:\WINDOWS\system32> fsutil 8dot3name set d: 0
Error:  Short name settings may not be changed on this volume due to the global registry setting.




[이 글에 대해서 여러분들과 의견을 공유하고 싶습니다. 틀리거나 미흡한 부분 또는 의문 사항이 있으시면 언제든 댓글 남겨주십시오.]

[연관 글]






[최초 등록일: ]
[최종 수정일: 1/28/2021]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-변경금지 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.
by SeongTae Jeong, mailto:techsharer at outlook.com

비밀번호

댓글 작성자
 




... 46  47  48  49  50  51  52  53  54  55  56  57  58  59  [60]  ...
NoWriterDateCnt.TitleFile(s)
12435정성태12/1/202025197Windows: 181. 윈도우 환경에서 클라이언트 소켓의 최대 접속 수 (4) - ReuseUnicastPort를 이용한 포트 고갈 문제 해결 [1]파일 다운로드1
12434정성태11/30/202019024Windows: 180. C# - dynamicport 값의 범위를 알아내는 방법
12433정성태11/29/202017770Windows: 179. 윈도우 환경에서 클라이언트 소켓의 최대 접속 수 (3) - SO_PORT_SCALABILITY파일 다운로드1
12432정성태11/29/202019261Windows: 178. 윈도우 환경에서 클라이언트 소켓의 최대 접속 수 (2) - SO_REUSEADDR [1]파일 다운로드1
12431정성태11/27/202016104.NET Framework: 976. UnmanagedCallersOnly + C# 9.0 함수 포인터 사용 시 x86 빌드에서 오동작하는 문제파일 다운로드1
12430정성태11/27/202018502오류 유형: 686. Ubuntu - E: The repository 'cdrom://...' does not have a Release file.
12429정성태11/25/202018581디버깅 기술: 175. windbg - 특정 Win32 API에서 BP가 안 걸리는 경우
12428정성태11/25/202016737VS.NET IDE: 154. Visual Studio - .NET Core App 실행 시 dotnet.exe 실행 화면만 나오는 문제
12427정성태11/24/202017604.NET Framework: 975. .NET Core를 직접 호스팅해 (runtimeconfig.json 없이) EXE만 배포해 실행파일 다운로드1
12426정성태11/24/202015991오류 유형: 685. WinDbg Preview - error InitTypeRead
12425정성태11/24/202017611VC++: 141. Visual C++ - "Treat Warnings As Errors" 옵션이 꺼져 있는데도 일부 경고가 에러 처리되는 경우
12424정성태11/24/202017946VC++: 140. C++의 연산자 동의어(operator synonyms), 대체 토큰 [1]
12423정성태11/22/202018572.NET Framework: 974. C# 9.0 - (16) 제약 조건이 없는 형식 매개변수 주석(Unconstrained type parameter annotations)파일 다운로드1
12422정성태11/21/202016006.NET Framework: 973. .NET 5, .NET Framework에서만 허용하는 UnmanagedCallersOnly 사용예파일 다운로드1
12421정성태11/19/202015282.NET Framework: 972. DNNE가 출력한 NE DLL을 직접 생성하는 방법파일 다운로드1
12420정성태11/19/202015209오류 유형: 684. Visual C++ - MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
12419정성태11/19/202016102VC++: 139. Visual C++ - .NET Core의 nethost.lib와 정적 링크파일 다운로드1
12418정성태11/19/202018348오류 유형: 683. Visual C++ - error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MT_StaticRelease' doesn't match value 'MDd_DynamicDebug'파일 다운로드1
12417정성태11/19/202016053오류 유형: 682. Visual C++ - warning LNK4099: PDB '...pdb' was not found with '...lib(pch.obj)' or at '...pdb'; linking object as if no debug info
12416정성태11/19/202017124오류 유형: 681. Visual C++ - error LNK2001: unresolved external symbol _CrtDbgReport
12415정성태11/18/202017400.NET Framework: 971. UnmanagedCallersOnly 특성과 DNNE 사용파일 다운로드1
12414정성태11/18/202019505VC++: 138. x64 빌드에서 extern "C"가 아닌 경우 ___cdecl name mangling 적용 [4]파일 다운로드1
12413정성태11/17/202018502.NET Framework: 970. .NET 5 / .NET Core - UnmanagedCallersOnly 특성을 사용한 함수 내보내기파일 다운로드1
12412정성태11/16/202020660.NET Framework: 969. .NET Framework 및 .NET 5 - UnmanagedCallersOnly 특성 사용파일 다운로드1
12411정성태11/12/202017430오류 유형: 680. C# 9.0 - Error CS8889 The target runtime doesn't support extensible or runtime-environment default calling conventions.
12410정성태11/12/202017580디버깅 기술: 174. windbg - System.TypeLoadException 예외 분석 사례
... 46  47  48  49  50  51  52  53  54  55  56  57  58  59  [60]  ...