Microsoft MVP성태의 닷넷 이야기
Windows: 187. Windows - 도스 시절의 8.3 경로를 알아내는 방법 [링크 복사], [링크+제목 복사],
조회: 16137
글쓴 사람
정성태 (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

비밀번호

댓글 작성자
 




... [61]  62  63  64  65  66  67  68  69  70  71  72  73  74  75  ...
NoWriterDateCnt.TitleFile(s)
12410정성태11/12/202017579디버깅 기술: 174. windbg - System.TypeLoadException 예외 분석 사례
12409정성태11/12/202019417.NET Framework: 968. C# 9.0의 Function pointer를 이용한 함수 주소 구하는 방법파일 다운로드1
12408정성태11/9/202034663도서: 시작하세요! C# 9.0 프로그래밍 [8]
12407정성태11/9/202019760.NET Framework: 967. "clr!JIT_DbgIsJustMyCode" 호출이 뭘까요?
12406정성태11/8/202020753.NET Framework: 966. C# 9.0 - (15) 최상위 문(Top-level statements) [5]파일 다운로드1
12405정성태11/8/202018600.NET Framework: 965. C# 9.0 - (14) 부분 메서드에 대한 새로운 기능(New features for partial methods)파일 다운로드1
12404정성태11/7/202019226.NET Framework: 964. C# 9.0 - (13) 모듈 이니셜라이저(Module initializers)파일 다운로드1
12403정성태11/7/202018134.NET Framework: 963. C# 9.0 - (12) foreach 루프에 대한 GetEnumerator 확장 메서드 지원(Extension GetEnumerator)파일 다운로드1
12402정성태11/7/202019628.NET Framework: 962. C# 9.0 - (11) 공변 반환 형식(Covariant return types) [1]파일 다운로드1
12401정성태11/5/202018899VS.NET IDE: 153. 닷넷 응용 프로그램에서의 "My Code" 범위와 "Enable Just My Code"의 역할 [1]
12400정성태11/5/202015132오류 유형: 679. Visual Studio - "Source Not Found" 창에 "Decompile source code" 링크가 없는 경우
12399정성태11/5/202018651.NET Framework: 961. C# 9.0 - (10) 대상으로 형식화된 조건식(Target-typed conditional expressions)파일 다운로드1
12398정성태11/4/202018160오류 유형: 678. Windows Server 2008 R2 환경에서 Powershell을 psexec로 원격 실행할 때 hang이 발생하는 문제
12397정성태11/4/202018183.NET Framework: 960. C# - 조건 연산자(?:)를 사용하는 경우 달라지는 메서드 선택 사례파일 다운로드1
12396정성태11/3/202015205VS.NET IDE: 152. Visual Studio - "Tools" / "External Tools..."에 등록된 외부 명령어에 대한 단축키 설정 방법
12395정성태11/3/202017977오류 유형: 677. SSMS로 DB 접근 시 The server principal "..." is not able to access the database "..." under the current security context.
12394정성태11/3/202015608오류 유형: 676. cacls - The Recycle Bin on ... is corrupted. Do you want to empty the Recycle Bin for this drive?
12393정성태11/3/202015276오류 유형: 675. Visual Studio - 닷넷 응용 프로그램 디버깅 시 Disassembly 창에서 BP 설정할 때 "Error while processing breakpoint." 오류
12392정성태11/2/202019820.NET Framework: 959. C# 9.0 - (9) 레코드(Records) [4]파일 다운로드1
12390정성태11/1/202019471디버깅 기술: 173. windbg - System.Configuration.ConfigurationErrorsException 예외 분석 방법
12389정성태11/1/202018614.NET Framework: 958. C# 9.0 - (8) 정적 익명 함수 (static anonymous functions)파일 다운로드1
12388정성태10/29/202017669오류 유형: 674. 어느 순간부터 닷넷 응용 프로그램 실행 시 System.Configuration.ConfigurationErrorsException 예외가 발생한다면?
12387정성태10/28/202018459.NET Framework: 957. C# - static 필드의 정보가 GC Heap에 저장될까요? [3]파일 다운로드1
12386정성태10/28/202019198Linux: 34. 사용자 정보를 함께 출력하는 리눅스의 ps 명령어 사용 방법
12385정성태10/28/202016528오류 유형: 673. openssl - req: No value provided for Subject Attribute CN, skipped
12384정성태10/27/202018870오류 유형: 672. AllowPartiallyTrustedCallers 특성이 적용된 어셈블리의 struct 멤버 메서드를 재정의하면 System.Security.VerificationException 예외 발생
... [61]  62  63  64  65  66  67  68  69  70  71  72  73  74  75  ...