visual studio code(비주얼 스튜디오 코드) update 실행하여 설치후 바탕화면 과 파일 연결된 아이콘이 흰색 문서 아이콘으로 바뀌는 에러 해결법

vscode 아이콘


* 레지스트리 수정


    - 설치 경로가 "C:\Users\\[사용자이름]\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe 인 경우

Windows Registry Editor Version 5.00

; 안될때는 기본앱 설정(기본앱이 바뀌면 아이콘도 바뀜)

; UserChoiceLatest 키를 삭제해야 설정한 아이콘으로 표시됨
[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\UserChoice]

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\UserChoiceLatest]

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\OpenWithList]

[-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\OpenWithProgids]

; 재설정
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\OpenWithList]
"a"="Code.exe"
"MRUList"="a"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\OpenWithProgids]
"VSCode.Workspace"=hex(0):

; 
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\UserChoice]
"ProgId"="VSCode.code-workspace"

; 기본앱 설정하면 생김, Hash 값도 맞아야 해서 레지스트리만 변경해서는 안된다. 기본앱 설정 필요
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.code-workspace\UserChoiceLatest\ProgId]
"ProgId"="VSCode.code-workspace"

; 설치시 이름을 유지해야 설정한 아이콘으로 표시됨 : Code Workspace 원본 파일 -> VSCode.Workspace
[HKEY_CLASSES_ROOT\.code-workspace]
@="VSCode.Workspace"

[HKEY_CLASSES_ROOT\VSCode.code-workspace]
@="VSCode.Workspace"

; open 으로 해야 우클릭 메뉴에 정확한 정보가 표시됨
[HKEY_CLASSES_ROOT\VSCode.code-workspace\shell]
@="open"


[HKEY_CLASSES_ROOT\.code-workspace\DefaultIcon]
@="%LOCALAPPDATA%\\Programs\\Microsoft VS Code\\Code.exe,0"
; @="D:\\Util\\icons\\VSCode.ico"


[HKEY_CLASSES_ROOT\VSCode.code-workspace\DefaultIcon]
@="%LOCALAPPDATA%\\Programs\\Microsoft VS Code\\Code.exe,0"
; @="D:\\Util\\icons\\VSCode.ico"


[HKEY_CLASSES_ROOT\VSCode.code-workspace\shell\open]
"Icon"="%LOCALAPPDATA%\\Programs\\Microsoft VS Code\\Code.exe,0"
; "Icon"="D:\\Util\\icons\\VSCode.ico"

; -------------------------------------------------------------------------------
;  *.code-workspace 파일의 기본 실행파일을 vs code 로 설정

; .code-workspace -> VSCode.Workspace ProgID 연결
[HKEY_CLASSES_ROOT\.code-workspace]
@="VSCode.Workspace"

; VSCode.Workspace 기본 동작을 open으로 설정
[HKEY_CLASSES_ROOT\VSCode.Workspace\shell]
@="open"

; open 명령: VS Code로 해당 파일 열기
[HKEY_CLASSES_ROOT\VSCode.Workspace\shell\open\command]
@="\"%LOCALAPPDATA%\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""

 


-------------------------------------------------------------------------------

Open with VSCode, Cursor, Antigravity

 

:: %LOCALAPPDATA%를 경로에 사용하는 경우 레지스트리 파일에서는 hex (REG_EXPAND_SZ ) 값으로 써야 한다. 그래서 reg 명령어 사용
:: 환경변수를 @="%LOCALAPPDATA%"에서 사용하면 환경변수 해석을 하지 못한다. Icon="%LOCALAPPDATA%" 과 같은 곳에서는 해석 가능

 

:: %LOCALAPPDATA%를 경로에 사용하는 경우 레지스트리 파일에서는 hex (REG_EXPAND_SZ ) 값으로 써야 한다. 그래서 reg 명령어 사용
:: 환경변수를 @="%LOCALAPPDATA%"에서 사용하면 환경변수 해석을 하지 못한다. Icon="%LOCALAPPDATA%" 과 같은 곳에서는 해석 가능

:: =========================
:: Open with VSCode
:: =========================
reg add "HKCR\VSCode.Workspace\shell\Open with VSCode" /ve /d "Open with &VSCode" /f
reg add "HKCR\VSCode.Workspace\shell\Open with VSCode" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\",0" /f
reg add "HKCR\VSCode.Workspace\shell\Open with VSCode\command" /ve /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\" \"%1\"" /f

reg add "HKCR\VSCode.code-workspace\shell\Open with VSCode" /ve /d "Open with &VSCode" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with VSCode" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\",0" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with VSCode\command" /ve /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\" \"%1\"" /f

reg add "HKCR\Cursor.code-workspace\shell\Open with VSCode" /ve /d "Open with &VSCode" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with VSCode" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\",0" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with VSCode\command" /ve /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\" \"%1\"" /f

reg add "HKCR\Antigravity.code-workspace\shell\Open with VSCode" /ve /d "Open with &VSCode" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with VSCode" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\",0" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with VSCode\command" /ve /d "\"%LOCALAPPDATA%\Programs\Microsoft VS Code\Code.exe\" \"%1\"" /f


:: =========================
:: Open with Cursor1
:: =========================
reg add "HKCR\VSCode.Workspace\shell\Open with Cursor" /ve /d "Open with &Cursor1" /f
reg add "HKCR\VSCode.Workspace\shell\Open with Cursor" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\",0" /f
reg add "HKCR\VSCode.Workspace\shell\Open with Cursor\command" /ve /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\" \"%1\"" /f

reg add "HKCR\VSCode.code-workspace\shell\Open with Cursor" /ve /d "Open with &Cursor1" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with Cursor" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\",0" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with Cursor\command" /ve /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\" \"%1\"" /f

reg add "HKCR\Cursor.code-workspace\shell\Open with Cursor" /ve /d "Open with &Cursor1" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with Cursor" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\",0" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with Cursor\command" /ve /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\" \"%1\"" /f

reg add "HKCR\Antigravity.code-workspace\shell\Open with Cursor" /ve /d "Open with &Cursor1" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with Cursor" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\",0" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with Cursor\command" /ve /d "\"%LOCALAPPDATA%\Programs\cursor\Cursor.exe\" \"%1\"" /f


:: =========================
:: Open with Antigravity1
:: =========================
reg add "HKCR\VSCode.Workspace\shell\Open with Antigravity" /ve /d "Open with &Antigravity1" /f
reg add "HKCR\VSCode.Workspace\shell\Open with Antigravity" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\",0" /f
reg add "HKCR\VSCode.Workspace\shell\Open with Antigravity\command" /ve /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\" \"%1\"" /f

reg add "HKCR\VSCode.code-workspace\shell\Open with Antigravity" /ve /d "Open with &Antigravity1" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with Antigravity" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\",0" /f
reg add "HKCR\VSCode.code-workspace\shell\Open with Antigravity\command" /ve /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\" \"%1\"" /f

reg add "HKCR\Cursor.code-workspace\shell\Open with Antigravity" /ve /d "Open with &Antigravity1" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with Antigravity" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\",0" /f
reg add "HKCR\Cursor.code-workspace\shell\Open with Antigravity\command" /ve /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\" \"%1\"" /f

reg add "HKCR\Antigravity.code-workspace\shell\Open with Antigravity" /ve /d "Open with &Antigravity1" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with Antigravity" /v Icon /t REG_SZ /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\",0" /f
reg add "HKCR\Antigravity.code-workspace\shell\Open with Antigravity\command" /ve /d "\"%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe\" \"%1\"" /f

 


-------------------------------------------------------------------------------
* 아이콘 캐쉬 삭제 명령
    - 바뀐 설정을 재부팅없이 적용

    - 관리자 권한으로 실행

IconCacheClear.bat
0.00MB

taskkill /IM explorer.exe /F 

cd /d  "%userprofile%\AppData\Local"
attrib -h "IconCache.db"
del "IconCache.db"

cd /d "%localappdata%\Microsoft\Windows\Explorer"
attrib -h "*.db"
del "*.db"

start explorer.exe

 

반응형
Posted by codens