|
Post by pablosl on Feb 24, 2019 17:32:59 GMT -5
I want to give the users of my program the option to associate/disassociate a File Extension (such as .zip) with my app. My application manipulates files with the .zip extension, so registering the file type instructs the operating system to open the file with my application when the user double-clicks its icon.
I know that some installers as InstallShield do this at installation stage, but I want (using a checkbox) to let the users decide to associate or disassociate the .zip file extension.
Can somebody write the API snippet for me? Thanks in advance.
- Pablo
|
|
ntech
New Member
Posts: 49
|
Post by ntech on May 10, 2019 10:45:09 GMT -5
I've written up a .bat (batch) file you can run to set a sample file association
ftype My.ZIP=<replace with application full path> assoc .zip=My.ZIP
You can programmatically generate such a file using LibertyBasic to suit any file association:
assocName$ = "My.ZIP" fullPathToThisApplication$ = "C:\LibertyBasic\myapp.exe" extension$ = "zip"
open "set.bat" for output as #o
print #o, "ftype ";assocName$;"=";fullPathToThisApplication$ print #o, "assoc .";extension$;"=";assocName$
close #o
run "set.bat"
notice "The file ."+extension$+" has been set to this program."
|
|