Microsoft MVP성태의 닷넷 이야기
Windows: 187. Windows - 도스 시절의 8.3 경로를 알아내는 방법 [링크 복사], [링크+제목 복사],
조회: 8459
글쓴 사람
정성태 (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)
12664정성태6/9/20217769오류 유형: 723. COM+ PIA 참조 시 "This operation failed because the QueryInterface call on the COM component" 오류
12663정성태6/9/20219316.NET Framework: 1065. Windows Forms - 속성 창의 디자인 설정 지원: 문자열 목록 내에서 항목을 선택하는 TypeConverter 제작파일 다운로드1
12662정성태6/8/20218405.NET Framework: 1064. C# COM 개체를 PIA(Primary Interop Assembly)로써 "Embed Interop Types" 참조하는 방법파일 다운로드1
12661정성태6/4/202119082.NET Framework: 1063. C# - MQTT를 이용한 클라이언트/서버(Broker) 통신 예제 [4]파일 다운로드1
12660정성태6/3/202110161.NET Framework: 1062. Windows Forms - 폼 내에서 발생하는 마우스 이벤트를 자식 컨트롤 영역에 상관없이 수신하는 방법 [1]파일 다운로드1
12659정성태6/2/202111396Linux: 40. 우분투 설치 후 MBR 디스크 드라이브 여유 공간이 인식되지 않은 경우 - Logical Volume Management
12658정성태6/2/20218851Windows: 194. Microsoft Store에 있는 구글의 공식 Youtube App
12657정성태6/2/202110111Windows: 193. 윈도우 패키지 관리자 - winget 설치
12656정성태6/1/20218351.NET Framework: 1061. 서버 유형의 COM+에 적용할 수 없는 Server GC
12655정성태6/1/20217806오류 유형: 722. windbg/sos - savemodule - Fail to read memory
12654정성태5/31/20217835오류 유형: 721. Hyper-V - Saved 상태의 VM을 시작 시 오류 발생
12653정성태5/31/202110526.NET Framework: 1060. 닷넷 GC에 새롭게 구현되는 DPAD(Dynamic Promotion And Demotion for GC)
12652정성태5/31/20218657VS.NET IDE: 164. Visual Studio - Web Deploy로 Publish 시 암호창이 매번 뜨는 문제
12651정성태5/31/20218906오류 유형: 720. PostgreSQL - ERROR: 22P02: malformed array literal: "..."
12650정성태5/17/20218226기타: 82. OpenTabletDriver의 버튼에 더블 클릭을 매핑 및 게임에서의 지원 방법
12649정성태5/16/20219550.NET Framework: 1059. 세대 별 GC(Garbage Collection) 방식에서 Card table의 사용 의미 [1]
12648정성태5/16/20218190사물인터넷: 66. PC -> FTDI -> NodeMCU v1 ESP8266 기기를 UART 핀을 연결해 직렬 통신하는 방법파일 다운로드1
12647정성태5/15/20219433.NET Framework: 1058. C# - C++과의 연동을 위한 구조체의 fixed 배열 필드 사용파일 다운로드1
12646정성태5/15/20218569사물인터넷: 65. C# - Arduino IDE의 Serial Monitor 기능 구현파일 다운로드1
12645정성태5/14/20218257사물인터넷: 64. NodeMCU v1 ESP8266 - LittleFS를 이용한 와이파이 접속 정보 업데이트파일 다운로드1
12644정성태5/14/20219429오류 유형: 719. 윈도우 - 제어판의 "프로그램 및 기능" / "Windows 기능 켜기/끄기" 오류 0x800736B3
12643정성태5/14/20218621오류 유형: 718. 서버 유형의 COM+ 사용 시 0x80080005(Server execution failed) 오류 발생
12642정성태5/14/20219544오류 유형: 717. The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.
12641정성태5/13/20219248디버깅 기술: 179. 윈도우용 .NET Core 3 이상에서 Windbg의 sos 사용법
12640정성태5/13/202112183오류 유형: 716. RDP 연결 - Because of a protocol error (code: 0x112f), the remote session will be disconnected. [1]
12639정성태5/12/20219086오류 유형: 715. Arduino: Open Serial Monitor - The module '...\detection.node' was compiled against a different Node.js version using NODE_MODULE_VERSION
... 31  32  33  34  35  36  37  38  [39]  40  41  42  43  44  45  ...