Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Extention Associations
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00482492
Message ID:
00482498
Views:
11
Does anyone know how to programatically associate a file extention with an executable?

One way: I will skip a couple of steps

I have a file (lcFilename) called Test.txt that I want to run in word -- not the normal notepad or wordpad

1.) Parse out the extension (lcEXTension) for the file that (lcFileName) you want to run Example: lcExtension=justext(lcFileName) = "txt"

2.) Decide what app you want to run for that extension (lcApplication) (example : lcApplication="Winword.exe" -- you probably need the path)

3.) Run it
IF ATC(" ", lcfilename) >0
lcfilename='"'+lcfilename+'"' && check for spaces in file name
Endif
lcopenfile=lcApplication+' '+lcfilename2
RUN /n &lcopenfile

Make any sense?

Kevin
Kevin Emmrich
www.jkt9000.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform