Posts: 767
Threads: 262
Joined: Jul 2012
Is there a way to associate an application to a file extension.
For example ".txt" associated with 'Notepad++' (Every time a .txt get's double clicked, it will be opened with 'Notepad++'
I now have a rather long macro that does through the GUI, (right click on file, open "Properties", click button "Change..." , etc...).
I tried to find a more direct way through commandline, but I could not find a way.
Can QM handle this?
Posts: 12,086
Threads: 142
Joined: Dec 2002
Look in the file category.
file.FileTypeRegister and other similar functions.
Posts: 767
Threads: 262
Joined: Jul 2012
wow!
Didn't know about that!!!
Thank you, this will cut down my macro size!!!
Thank you!!!!!
Posts: 767
Threads: 262
Joined: Jul 2012
07-14-2018, 02:58 PM
(This post was last modified: 07-14-2018, 03:00 PM by r0n.)
Sorry to kick this topic up but in windows 7 this worked perfectly.
Recently I moved to windows 10 and the function generates an error, I used the F1 example of FileTypeRegister to try it in it's most basic form but it errors at the FileTypeRegister command:
Macro
Macro40
FileTypeRegister "vig" "vigfile" "Vig File" "shell32.dll,20" "notepad.exe ''%1''"
str s="test"
s.setfile("$desktop$\test.vig")
run "$desktop$\test.vig"
Also tried
Macro
Macro40
FileTypeRegister "vig" "vigfile" "Vig File" "d:\npp\notepad++.exe" "d:\npp\notepad++.exe ''%1''"
str s="test"
s.setfile("$desktop$\test.vig")
run "$desktop$\test.vig"
Posts: 1,337
Threads: 61
Joined: Jul 2006
first example worked no problem for me on win10
second example had to change slightly to get it to work
FileTypeRegister "vig" "vigfile" "Vig File" "C:\Program Files\Notepad++\notepad++.exe" "notepad++.exe ''%1''"
str s="test"
s.setfile("$desktop$\test.vig")
run "$desktop$\test.vig"
Posts: 12,086
Threads: 142
Joined: Dec 2002
Macro
Macro7
;/exe 2
FileTypeRegister "vig" "vigfile" "Vig File" "shell32.dll,20" "notepad.exe ''%1''"
;BEGIN PROJECT
;END PROJECT
Posts: 767
Threads: 262
Joined: Jul 2012
@Kevin and Gintaras,
thanks!