Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add my program to Explorer context menu

Status
Not open for further replies.

MoaTad

Programmer
Jun 7, 2002
27
US
Hi All,

I have a small VB6 app that does some operations on text files. Instead of having the user start my app and then select the file, I would like for them to be able to locate the file in Windows Explorer and right-click on it to launch my app, passing it the path and filename.

Anyone know how to do this?

Thanks in advance!

 
You first have to create an association to do this. For specific directions on how to go about this I would need to know your operating system. But in most cases, if you hold down the shift key and then right-click on a file, you can get an open with option and you can set the association there.

After you've set the assocation, when you double click the associated file, windows opens the associate program and sends the file path as a parameter.

The command line (with the exception of the exe name) can be read by using the Command statement. So it would look something like this:

Code:
Dim MyParameters As String

MyParameters = Command

If MyParameters = "" Then
    'No parameters sent
Else
    'Parameters Sent
End if

Hope this helps!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top