Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
MaloK

(BartPE) How to create file Association ?

Recommended Posts


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.

Share this post


Link to post
Share on other sites

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"" %*"

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...