Click here to Skip to main content
15,917,971 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have set a file extension to open my vb program when I click from Windows Explorer.
How do I get my Program to recognize and load the file?
Tom..
Posted
Updated 13-Nov-13 6:55am
v2
Comments
Sergey Alexandrovich Kryukov 13-Nov-13 12:50pm    
Probably you did not "set" it yet. And how it that related to Javascript?
—SA
Tom Moody 13-Nov-13 12:52pm    
Set what?
Sergey Alexandrovich Kryukov 13-Nov-13 13:04pm    
This is your word. Look at your own post...
—SA
joshrduncan2012 13-Nov-13 17:01pm    
I'm not even sure this is even a programming question. What comes to mind is teaching Windows to recognize a particular file extension. Just food for thought.
joshrduncan2012 13-Nov-13 17:01pm    
I'm not even sure this is even a programming question. What comes to mind is teaching Windows to recognize a particular file extension. Just food for thought.

Assuming that you have properly setup your unique file extension to be associated with your program's exe, the following paragraph will help you determine how to retrieve the filename in your program. Your program should be compiled in Release mode and your program should be in the same directory structure and have the same name as the full path name that you used when you setup the association between your unique extension and your program.

Your program can retrieve its commandline value using Environment.CommandLine.
After retrieving the commandline from Environment.CommandLine, parse the commandline to get the filename.

1. The first value in the commandline is the full path name of your program.
2. The second value in the commandline is the name of the file that you double-clicked on in Explorer.
 
Share this answer
 
Thanks Mike.... That is exactly what i needed..
Thanks again ..tom
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900