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

비밀번호

댓글 작성자
 




... 31  32  33  34  35  [36]  37  38  39  40  41  42  43  44  45  ...
NoWriterDateCnt.TitleFile(s)
12739정성태7/28/20217361오류 유형: 746. Azure Active Directory - IDW10106: The 'ClientId' option must be provided.
12738정성태7/28/20217966오류 유형: 745. Azure Active Directory - Client credential flows must have a scope value with /.default suffixed to the resource identifier (application ID URI).
12737정성태7/28/20216919오류 유형: 744. Azure Active Directory - The resource principal named api://...[client_id]... was not found in the tenant
12736정성태7/28/20217472오류 유형: 743. Active Azure Directory에서 "API permissions"의 권한 설정이 "Not granted for ..."로 나오는 문제
12735정성태7/27/20217984.NET Framework: 1081. C# - Azure AD 인증을 지원하는 데스크톱 애플리케이션 예제(Windows Forms) [2]파일 다운로드1
12734정성태7/26/202123943스크립트: 20. 특정 단어로 시작하거나/끝나는 문자열을 포함/제외하는 정규 표현식 - Look-around
12733정성태7/23/202111217.NET Framework: 1081. Self-Contained/SingleFile 유형의 .NET Core/5+ 실행 파일을 임베딩한다면? [1]파일 다운로드2
12732정성태7/23/20216530오류 유형: 742. SharePoint - The super user account utilized by the cache is not configured.
12731정성태7/23/20217724개발 환경 구성: 584. Add Internal URLs 화면에서 "Save" 버튼이 비활성화 된 경우
12730정성태7/23/20219238개발 환경 구성: 583. Visual Studio Code - Go 코드에서 입력을 받는 경우
12729정성태7/22/20218199.NET Framework: 1080. xUnit 단위 테스트에 메서드/클래스 수준의 문맥 제공 - Fixture
12728정성태7/22/20217643.NET Framework: 1079. MSTestv2 단위 테스트에 메서드/클래스/어셈블리 수준의 문맥 제공
12727정성태7/21/20218652.NET Framework: 1078. C# 단위 테스트 - MSTestv2/NUnit의 Assert.Inconclusive 사용법(?) [1]
12726정성태7/21/20218470VS.NET IDE: 169. 비주얼 스튜디오 - 단위 테스트 선택 시 MSTestv2 외의 xUnit, NUnit 사용법 [1]
12725정성태7/21/20217169오류 유형: 741. Failed to find the "go" binary in either GOROOT() or PATH
12724정성태7/21/20219913개발 환경 구성: 582. 윈도우 환경에서 Visual Studio Code + Go (Zip) 개발 환경 [1]
12723정성태7/21/20217542오류 유형: 740. SharePoint - Alternate access mappings have not been configured 경고
12722정성태7/20/20217355오류 유형: 739. MSVCR110.dll이 없어 exe 실행이 안 되는 경우
12721정성태7/20/20217960오류 유형: 738. The trust relationship between this workstation and the primary domain failed. - 세 번째 이야기
12720정성태7/19/20217332Linux: 43. .NET Core/5+ 응용 프로그램의 Ubuntu (Debian) 패키지 준비
12719정성태7/19/20216509오류 유형: 737. SharePoint 설치 시 "0x800710D8 The object identifier does not represent a valid object." 오류 발생
12718정성태7/19/20217090개발 환경 구성: 581. Windows에서 WSL로 파일 복사 시 root 소유권으로 적용되는 문제파일 다운로드1
12717정성태7/18/20217041Windows: 195. robocopy에서 파일의 ADS(Alternate Data Stream) 정보 복사를 제외하는 방법
12716정성태7/17/20217867개발 환경 구성: 580. msbuild의 Exec Task에 robocopy를 사용하는 방법파일 다운로드1
12715정성태7/17/20219503오류 유형: 736. Windows - MySQL zip 파일 버전의 "mysqld --skip-grant-tables" 실행 시 비정상 종료 [1]
12714정성태7/16/20218283오류 유형: 735. VCRUNTIME140.dll, MSVCP140.dll, VCRUNTIME140.dll, VCRUNTIME140_1.dll이 없어 exe 실행이 안 되는 경우
... 31  32  33  34  35  [36]  37  38  39  40  41  42  43  44  45  ...