lanjelot wrote:
I am looking for a fast and convenient way to associate ascii files (eg: *.cpp, *.aspx, *.txt, *.rc, etc...) to SciTE.

Am i the only one looking for such an automatic operation ?

Can you please let me know if there is any easy way to register many file types to SciTE ?

I was thinking, maybe a batch file script would do. But since i'm not an expert at manually editing the windows registry, i was wondering maybe there are some people who have already done such scripts (and are willing to share them to some newbies ;p).

No batch file, a simple .reg file can do the job, ie. an export of registry keys/values that can be imported back after changes.

On Windows 98/NT, I used the following file to associate SciTE to *all* filetypes, Ascii or binary. This is possible because SciTE can handle most binary types and I have made a test (max.file.size) to avoid loading accidentally files too big...

-----8<-----
REGEDIT4

[HKEY_CLASSES_ROOT\*\shell\edit]
@="Edit with &SciTE"

[HKEY_CLASSES_ROOT\*\shell\edit\command]
; Adapt path to your...
@="\"C:\\Program Files\\UTexts\\SciTE\\SciTE.exe\" \"%1\""

[HKEY_CLASSES_ROOT\*\shell\print\command]
; Optional, of course
@="\"C:\\Program Files\\UTexts\\SciTE\\SciTE.exe\" /p \"%1\""
----->8-----

Note that files without preset association (eg. .xyz) are opened in SciTE when double-clicking on them, while those with existing association retain their default open program, "Edit with SciTE" is still in the context menu, but you have to choose it explicitely when right-clicking on them.

Now, I use my own program, ProgLauncher, to replace notepad.exe and thus automatically open in SciTE all files associated to Notepad.

Alas, both tricks fails in Windows XP. For some reason, SciTE appears only in the "Open With" menu, and not every time. And I failed to replace Notepad because XP SP 2 resists to most tricks allowing to replace a system file: it "autorepairs" Notepad whenever I replace it. And since the XP archive is on D disk, the trick stating to ignore the plea to insert the XP CD doesn't work...

Anyway, you can quickly make your associations, with or without overriding the existing ones.
Oh well, for details, go see my page:
http://phi.lho.free.fr/windows_tips/FileAssociations.en.html
I will update this page with this message...

In short, make a .reg file with the following lines:

-----8<-----
[HKEY_CLASSES_ROOT\cfile\shell]
; Default value (double-clik & bold menu item).
; If not there, default value is first (chronologically)
; entered shell verb (Windows/already installed prog)
@="EditWithSciTE"

[HKEY_CLASSES_ROOT\cfile\shell\EditWithSciTE]
; Displayed context menu entry
@="Edit with &SciTE"

[HKEY_CLASSES_ROOT\cfile\shell\EditWithSciTE\command]
; Update path...
@="\"C:\\Program Files\\UTexts\\SciTE\\SciTE.exe\" \"%1\""
----->8-----

and duplicate these lines, replacing cfile with whatever name you want to associate to: textfile, hppfile, etc.

This allow to keep the original file associations, eg. DevStudio ones, or IE/Firefox for HTML files, etc.

To exclusively open with SciTE, just override the open verb:

-----8<-----
[HKEY_CLASSES_ROOT\cfile\shell\open\command]
; Update path...
@="\"C:\\Program Files\\UTexts\\SciTE\\SciTE.exe\" \"%1\""
----->8-----

HTH.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --
_______________________________________________
Scite-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scite-interest

Reply via email to