Jump to content

(BartPE) How to create file Association ?


Recommended Posts


Posted

try using assoc.exe

Displays or modifies file extension associations

ASSOC [.ext[=[fileType]]]

 .ext      Specifies the file extension to associate the file type with
 fileType  Specifies the file type to associate with the file extension

Type ASSOC without parameters to display the current file associations.
If ASSOC is invoked with just a file extension, it displays the current
file association for that file extension.  Specify nothing for the file
type and the command will delete the association for the file extension.

Posted

To create file associations from the command prompt, you may need one or both of, eg

assoc .rex=Regina
ftype Regina=e:\programs\exe\regina.exe %%1 %*

To make the association more permanent (that is, every time you boot BartPE), you need to modify the source .inf file.

[Software.AddReg]
; --- REX ---
0x1,"Classes\.rex","","rexxfile"
0x1,"Classes\rexxfile","","Regina Rexx"
0x2,"Classes\rexxfile\DefaultIcon","",""%SystemDrive%\Programs\exe\regina.exe",1"
0x2,"Classes\rexxfile\shell\open\command","","""%SystemDrive%\Programs\exe\regina.EXE"" ""%1"" %*"

Posted

os2fan2 i like your method (with the inf file) i will use it in the future i managed my way by creating a plugin that goes like this

assoc.inf:

; assoc.inf
; PE Builder v3 plug-in INF file For Assoc
; Created by MaloK

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="File Association"
Enable=1
Help=""

[SourceDisksFiles]
autorun_assoc.cmd=2,,1

autorun_assoc.cmd:

reg add HKCR\.jpg /ve /t REG_SZ /d jpgfile
reg add HKCR\jpgfile\shell\open\command /ve /t REG_SZ /d "%systemdrive%\programs\irfanview\i_view32.exe %%1"

reg add HKCR\.bmp /ve /t REG_SZ /d bmp_auto_file
reg add HKCR\bmp_auto_file\shell\open\command /ve /t REG_SZ /d "%systemdrive%\programs\irfanview\i_view32.exe %%1"

exit

Associates *.jpg and *.bmp with Irfanview as an example,

it Works but the way you do it is cleaner many thanks for the info... :thumbup

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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