Help - Search - Members - Calendar
Full Version: (BartPE) How to create file Association ?
MSFN Forums > Unattended Windows Discussion & Support > Windows PE

   
Google Internet Forums Unattended CD/DVD Guide
MaloK
can someone provide an example how to create file association in BPE please ....
edg21
try using assoc.exe

CODE
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.
os2fan2
To create file associations from the command prompt, you may need one or both of, eg

CODE
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.

CODE
[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"" %*"
MaloK
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:
CODE
; 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:
CODE
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.gif
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.