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!

How to set up File Association and determine the file

Status
Not open for further replies.

KLK000

MIS
May 22, 2002
37
US
I have a program that reads files with a .tsp extension. When a user double-clicks on a .tsp file, I'd like my program to run and open the .tsp file. I've setup a File Association for .tsp files to run my program - this works. However, what code do I need to pick up the file that was clicked on? I've tried getting the command line args but it always returns no args. I suppose if I ran "myProg file.tsp", it would work but I would prefer just double-clicking on the .tsp file.
 
It would be the command-line arg. It sounds like the command-line of the association does not have the argument in it - you need %1 with quotes:

Command: c:\progampathxxxx\youprogram.exe "%1"

Also switch off "DDE" unless you know how to deal with it (remove the DDE subkeys if you are reg-editing).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top