0

I have compiled a C++ program that reads custom .lang files. Right now, the program prompts the user asking to enter the file and it opens.

I want the program to run when a file with the extension .lang is clicked. I have set the exe to be able to open .lang files with the Command Prompt. I am then trying to set the default program for .lang to this exe, but it does not change, but does not show any errors.

A link to the default extension im setting

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Mezza Man
  • 63
  • 1
  • 2
  • 8
  • Could you please share some part of the code . – abhi312 Nov 21 '18 at 05:04
  • Right now i just want the exe to run when a file with the .lang extension is clicked, will you still need to look at the code? its quite a large file – Mezza Man Nov 21 '18 at 05:07
  • *I have set the exe to be able to open .lang files with the Command Prompt.* how? And how did you manage to get two identical extensions (`.lang` x 2) into that list in the picture? – Swordfish Nov 21 '18 at 05:22
  • Read MSDN's documentation: [Implementing a Custom File Format](https://learn.microsoft.com/en-us/windows/desktop/shell/customizing-file-types-bumper), in particular [Registering a File Type](https://learn.microsoft.com/en-us/windows/desktop/shell/fa-file-types#registering-a-file-type) – Remy Lebeau Nov 21 '18 at 05:26
  • Im not really sure at all how i got 2. To set the exe to be able to open .lang files, i use the command prompt command `assoc .lang=C:\Users\PC\Documents\Visual Studio 2017\Projects\CPlusPlusProject\Debug\CPlusPlusProject.exe` – Mezza Man Nov 21 '18 at 05:26
  • `assoc` can't be used in that way. It expects a `` behind `=`, not the path to an executable. – Swordfish Nov 21 '18 at 05:56
  • @Swordfish Thanks, i understand now but how can i make **.lang** open the executable? – Mezza Man Nov 23 '18 at 09:28
  • @MezzaMan Please see the links, Remy Lebeau posted as a comment. – Swordfish Nov 23 '18 at 15:44

0 Answers0