ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Registry Help...

(1/2) > >>

Renox:
I have many different programs that I have written but I have not been able to register them with windows so that when u double-click the executable it doesn't prompt you to Allow the program to run... I know that alot of installers offer the option but I was wondering if anyone knew how to do it using a batch file or with Visual C++... All I need to learn how to do is create an entry in the registry so that windows automatically knows that the program is safe...

Ruffnekk:
The easiest way is to add an entry to the registry under HKEY_CLASSES_ROOT. Just fire regedit and take a look around the defined keys and values there.

Basically you first create a subkey in HKCR that defines the extension. The keyname is a dot followed by the extension you want to associate. Once you created this key, you change the value of (default) to the name of your app or something that describes the file. Under HKCR you create another subkey with that exact same app name or description. Now your extension points to this key. Under this key you create another subkey 'Shell', which has a subkey 'Open', which has a subkey 'Command'. Here you can change (default) value to the command that must be launched when Open is chosen in the context menu or the file is double-clicked.

Renox:
is there anyway to do this programmatically so that when a person runs the program for the first time, I can have it ask them if they want to register it for future reference... That way I dont have to have the directions on how to install this somewhere for every person who ever downloads this... Thank you for your time and disregard any stupidity due to me being a young programmer!

tinjaw:
Renox,

Are you deploying your programs via an installer/setup? Most likely that will be available as an option in your installer/setup builder. If not, what programming language and tools are you using? As you will need to do it "manually" otherwise. (There are plenty of example out in the wild you can use to base your code off of.)

Carol Haynes:
Not a programmatic method but the simplest way you can set up or alteer a file association is to use Tools > Folder Options > File Types in Windows Explorer.

If you want to set it up so that the user doesn't have to do anything you will need to set it up as part of the installation routine.

Navigation

[0] Message Index

[#] Next page

Go to full version