Microsoft MVP성태의 닷넷 이야기
Windows: 187. Windows - 도스 시절의 8.3 경로를 알아내는 방법 [링크 복사], [링크+제목 복사],
조회: 8596
글쓴 사람
정성태 (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)
12401정성태11/5/202010856VS.NET IDE: 153. 닷넷 응용 프로그램에서의 "My Code" 범위와 "Enable Just My Code"의 역할 [1]
12400정성태11/5/20207788오류 유형: 679. Visual Studio - "Source Not Found" 창에 "Decompile source code" 링크가 없는 경우
12399정성태11/5/202011460.NET Framework: 961. C# 9.0 - (10) 대상으로 형식화된 조건식(Target-typed conditional expressions)파일 다운로드1
12398정성태11/4/202010004오류 유형: 678. Windows Server 2008 R2 환경에서 Powershell을 psexec로 원격 실행할 때 hang이 발생하는 문제
12397정성태11/4/202010187.NET Framework: 960. C# - 조건 연산자(?:)를 사용하는 경우 달라지는 메서드 선택 사례파일 다운로드1
12396정성태11/3/20208467VS.NET IDE: 152. Visual Studio - "Tools" / "External Tools..."에 등록된 외부 명령어에 대한 단축키 설정 방법
12395정성태11/3/20209816오류 유형: 677. SSMS로 DB 접근 시 The server principal "..." is not able to access the database "..." under the current security context.
12394정성태11/3/20208198오류 유형: 676. cacls - The Recycle Bin on ... is corrupted. Do you want to empty the Recycle Bin for this drive?
12393정성태11/3/20208700오류 유형: 675. Visual Studio - 닷넷 응용 프로그램 디버깅 시 Disassembly 창에서 BP 설정할 때 "Error while processing breakpoint." 오류
12392정성태11/2/202012804.NET Framework: 959. C# 9.0 - (9) 레코드(Records) [4]파일 다운로드1
12390정성태11/1/202011055디버깅 기술: 173. windbg - System.Configuration.ConfigurationErrorsException 예외 분석 방법
12389정성태11/1/202010793.NET Framework: 958. C# 9.0 - (8) 정적 익명 함수 (static anonymous functions)파일 다운로드1
12388정성태10/29/202010248오류 유형: 674. 어느 순간부터 닷넷 응용 프로그램 실행 시 System.Configuration.ConfigurationErrorsException 예외가 발생한다면?
12387정성태10/28/202011033.NET Framework: 957. C# - static 필드의 정보가 GC Heap에 저장될까요? [3]파일 다운로드1
12386정성태10/28/202011264Linux: 34. 사용자 정보를 함께 출력하는 리눅스의 ps 명령어 사용 방법
12385정성태10/28/20209092오류 유형: 673. openssl - req: No value provided for Subject Attribute CN, skipped
12384정성태10/27/202010299오류 유형: 672. AllowPartiallyTrustedCallers 특성이 적용된 어셈블리의 struct 멤버 메서드를 재정의하면 System.Security.VerificationException 예외 발생
12383정성태10/27/202011197.NET Framework: 956. C# 9.0 - (7) 패턴 일치 개선 사항(Pattern matching enhancements) [3]파일 다운로드1
12382정성태10/26/20208913오류 유형: 671. dotnet build - The local source '...' doesn't exist
12381정성태10/26/202010583VC++: 137. C++ stl map의 사용자 정의 타입을 key로 사용하는 방법 [1]파일 다운로드1
12380정성태10/26/20207973오류 유형: 670. Visual Studio - Squash_FailureCommitsReset
12379정성태10/21/202011011.NET Framework: 955. .NET 메서드의 Signature 바이트 코드 분석 [1]파일 다운로드2
12378정성태10/15/202010417.NET Framework: 954. C# - x86/x64 환경에 따라 달라지는 P/Invoke 함수의 export 이름파일 다운로드1
12377정성태10/15/202011713디버깅 기술: 172. windbg - 파일 열기 시점에 bp를 걸어 파일명 알아내는 방법(Managed/Unmanaged)
12376정성태10/15/20208406오류 유형: 669. windbg - sos의 name2ee 명령어 실행 시 "Failed to request module list." 오류
12375정성태10/15/20209794Windows: 177. 윈도우 탐색기에서 띄우는 cmd.exe 창의 디렉터리 구분 문자가 'Yen(&#0165;)' 기호로 나오는 경우 [1]
... 46  47  48  49  [50]  51  52  53  54  55  56  57  58  59  60  ...