Jump to content
magace420

Change default program a file extension opens with

Recommended Posts

magace420

Hello I created a simple program to print labels with a Dymo Label Creator.  However there is one part I cant seem to figure out how to automate.  the labels are saved like this file1.label, I need to change all .label extensions to open with a file in the script folder named printlabel.exe 

 

I have been doing it manually by right clicking the .label file, going to properties, and changing the opens with settings.  Is there any simple command I can run to change them automatically without having to right click and go into the properties?

This is what I want to automate>

5abbb75109449_beforechange.PNG.1388b83f46a055afa33ac59c8a79d75c.PNG5abbb7bf47c5b_afterupdate.thumb.PNG.d0d9546dfe0dfbf401f54851f7d74bab.PNGupdated.PNG.d76a348e32e75766f05347d8a141f008.PNG

Hope my request is easy to understand.   Thanks!!

Share this post


Link to post
Share on other sites
Bilgus

Do you have something else that reads these .Label items why not Right click on one Choose - OPEN WITH select the checkmark next to always use selected application and choose your new default program?

Share this post


Link to post
Share on other sites
magace420

Well i only have to change it once, but I'm going to give it to a few others to use and this would be one less thing to explain if i can get the script to do it.

Share this post


Link to post
Share on other sites
Bilgus

Rather than restarting after you change your associations you should be able to call this function

#include <APIShellExConstants.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIShellEx.au3>

    _WinAPI_ShellChangeNotify($SHCNE_ASSOCCHANGED, SHCNF_IDLIST)

 

Edited by Bilgus

Share this post


Link to post
Share on other sites
JLogan3o13

File extension details are maintained in the registry, under HKEY_CLASSES_ROOT. If you do a search of the forum you will find where this has been done.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.