Jump to content

Registering file types


Recommended Posts

Hi,

My ua cd is getting along quite well, and now I'm starting to get into 'the details': Programs like 7z or notepad++ need to be registered to open 'their' files. I looked at the specified thread, but the suggested solution doesn't work for me (and since it is still a 'WIP', I think I'll try to find it myself...

In the example of Notepad++, I took a snapshot of my registry, installed the app, set the filetype-associations manually and took a second snapshot with RegShot 1.7. This gives the following comparison:

----------------------------------
Keys added:10
----------------------------------
HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++
HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe
HKLM\Software\Microsoft\Internet Explorer\View Source Editor
HKLM\Software\Microsoft\Internet Explorer\View Source Editor\Editor Name
HKLM\Software\CLASSES\Notepad++_file\shell\open
HKLM\Software\CLASSES\Notepad++_file\shell\open\command
HKLM\Software\CLASSES\.inc
HKLM\Software\CLASSES\.vb
HKLM\Software\CLASSES\.mak
HKLM\Software\Notepad++

----------------------------------
Values added:17
----------------------------------
HKLM\Software\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe\: "C:\Program Files\Notepad++\notepad++.exe"
HKLM\Software\Microsoft\Internet Explorer\View Source Editor\Editor Name\: "C:\Program Files\Notepad++\nppIExplorerShell.exe"
HKLM\Software\CLASSES\Notepad++_file\shell\open\command\: ""C:\PROGRAM FILES\NOTEPAD++\NOTEPAD++.EXE" "%1""
HKLM\Software\CLASSES\.inc\: "Notepad++_file"
HKLM\Software\CLASSES\.vb\: "Notepad++_file"
HKLM\Software\CLASSES\.mak\: "Notepad++_file"
HKLM\Software\CLASSES\.txt\: "Notepad++_file"
HKLM\Software\CLASSES\.ini\: "Notepad++_file"
HKLM\Software\CLASSES\.css\: "Notepad++_file"
HKLM\Software\CLASSES\.asp\: "Notepad++_file"
HKLM\Software\CLASSES\.nfo\: "Notepad++_file"
HKLM\Software\CLASSES\.php\: "Notepad++_file"
HKLM\Software\CLASSES\.log\: "Notepad++_file"
HKLM\Software\CLASSES\.vbs\: "Notepad++_file"

If I understand correctly, the file-associations are made in 2 steps:

1. There is a class added called 'Notepad++_file'

2. All selected file types are categorised under that class

My question is: would this command do the trick? (I would test it out, but the registry is something I'm completely unfamiliar with :()

@echo off
cmdow @ /hid
:: Register files with Notepad++
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file /f

REG ADD HKLM\SOFTWARE\Classes\.bsh /ve /d "Notepad++_file" /f
REG ADD HKLM\SOFTWARE\Classes\.inc /ve /d "Notepad++_file" /f
... (add the selected extensions here)
REG ADD HKLM\SOFTWARE\Classes\.vb /ve /d "Notepad++_file" /f

REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\shell\edit\command /ve /t REG_EXPAND_SZ /d "\"%%ProgramFiles%%\Notepad++\notepad++.exe\" \"%%1\"" /f
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\shell\Print\command /ve /t REG_EXPAND_SZ /d "\"%%ProgramFiles%%\Notepad++\notepad++.exe\" \"%%1\"" /f
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\shell\open\command /ve /t REG_EXPAND_SZ /d "\"%%ProgramFiles%%\Notepad++\notepad++.exe\" \"%%1\"" /f
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\DefaultIcon /ve /t REG_EXPAND_SZ /d "%%SystemRoot%%\system32\shscrap.dll,1" /f
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\shell\EditWithNP++ /ve /d "&Edit with Notepad++" /f
REG ADD HKLM\SOFTWARE\Classes\Notepad++_file\shell\EditWithNP++\command /ve /t REG_EXPAND_SZ /d "\"%%ProgramFiles%%\Notepad++\notepad++.exe\" \"%%1\"" /f

I mainly used the code from Yzöwl, but altered it to reflect my 'proposed solution'. Would it work, would it make any PC unstable or could it be used with maybe some corrections?

THX!

Zl.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...