Windows 8에서 응용 프로그램을 연결하는 PowerShell 스크립트(ftype / assoc 사용 가능)

Windows 8에서 응용 프로그램을 연결하는 PowerShell 스크립트(ftype / assoc 사용 가능)

Windows XP/Vista/7에서는 아래와 같이 ftype 및 assoc를 사용하여 기본값에서 벗어난 항목을 대량으로 다시 연결하는 것이 간단했습니다. 이는 모든 연결이 사용자가 원하는 대로 이루어지도록 시스템 설정에서 시간을 절약해 주는 중요한 방법이었습니다. 그렇지 않으면 새로 설치할 때 각 확장을 한 번에 하나씩 다시 연결하는 데 (매우) 시간이 많이 걸립니다.

Windows 8에서는 현재 이 중 어느 것도 작동하지 않는 것 같습니다. 예를 들어, 이제 .pdf 파일은 기본적으로 Microsoft의 Metro 앱 "Reader"와 연결됩니다. 많은 파일 형식(10개 또는 수백 개의 파일 형식)을 표준 데스크톱 앱(예: .pdf는 Microsoft Reader 대신 Adobe Reader와 연결해야 함)에 수동으로 다시 연결해야 하는 것은 새로운 Windows 8 설치에서 번거로운 작업입니다. 다음은 cmd 스크립트를 사용하여 Windows 7에서 이 작업을 수행한 방법에 대한 예입니다. 그러나 분명히 PowerShell의 발전으로 Windows 8에서 이 작업이 더 적합할 것입니다. 또한 이러한 Metro를 변경하려면 .NET에 대한 액세스가 필요할 수도 있습니다. 연결 및 cmd는 해당 작업에 나쁜 도구입니다).

저는 Metro 앱이 나쁘다고 생각하지 않습니다(태블릿에서는 이상적일 것입니다). 문제는 데스크톱 앱에 비해 기능이 엄청나게 제한되어 있으므로 모든 것을 신속하게 다시 연결할 수 있으면 좋을 것입니다(스크립트 작성). 데스크톱 앱(또는 태블릿에서 작업 중이고 해당 사용 사례에서 Metro 앱과 관련된 모든 항목을 원하는 경우 그 반대).

:: File assoc and ftype: RAR, ZIP, NFO, DIZ, CBR, CBZ, DJVU, etc
:: ####################
:: Note: at commandline, would type ftype txtNFO="%SystemRoot%\system32\NOTEPAD.EXE" "%1"
:: but in batch script have to double up the % characters, ftype txtNFO="%SystemRoot%\system32\NOTEPAD.EXE" "%%1"
:: plus note the " characters, have to be careful about these
if exist "C:\Program Files (x86)\7-Zip\7zFM.exe" ftype 7zFM="C:\Program Files (x86)\7-Zip\7zFM.exe" "%%1"
if exist "C:\Program Files\7-Zip\7zFM.exe" ftype 7zFM="C:\Program Files\7-Zip\7zFM.exe" "%%1"ftype txtNFO="%%SystemRoot%%\system32\NOTEPAD.EXE" "%%1"
ftype txtDIZ="%%SystemRoot%%\system32\NOTEPAD.EXE" "%%1"
ftype QuickPAR="D:\Toolkit\QuickPAR\QuickPAR.exe" "%%1"
ftype CDisplay="D:\Toolkit\CDisplay\CDisplay.exe" "%%1"
if exist "D:\Toolkit\Microsoft Reader\msreader.exe"         ftype MSReader="D:\Toolkit\Microsoft Reader\msreader.exe" "%%1"
if exist "D:\Toolkit\Mobipocket Reader\reader.exe"          ftype MobiPocket="D:\Toolkit\Mobipocket Reader\reader.exe" "%%1"
if exist "D:\Toolkit\Stanza\Stanza.exe"                     ftype Stanza="D:\Toolkit\Stanza\Stanza.exe" "%%1"
assoc .lit=MSReader
assoc .mobi=MobiPocket
assoc .prc=MobiPocket
assoc .azw=MobiPocket
assoc .epub=Stanza
assoc .par=QuickPAR
assoc .par2=QuickPAR
assoc .sfv=QuickPAR
assoc .md5=QuickPAR
assoc .7z=7zFM
assoc .rar=7zFM
assoc .zip=7zFM

관련 정보