TLOTS 0 Posted July 22, 2010 Hi, i search in the faq how to associate a extencion with my program, i found this: http://www.autoitscript.com/wiki/FAQ#How_can_I_register_a_file_type_with_my_program_.5Bor.5D_How_can_I_make_files_with_a_certain_extension_open_in_my_program.3F But the UDF non exist, i search in the forum and i don found it. some can give me a copy of the UDF "FileRegister"??? PD: Sorry my bad english, i know only a bit of english Share this post Link to post Share on other sites
Melba23 3,456 Posted July 22, 2010 TLOTS,Welcome to the AutoIt forum. If you look at the bottom of the section on the Wiki page to which you linked, you will see:Download here: FileRegister.au3I have just tried to download the file from there and it worked perfectly. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
Melba23 3,456 Posted July 22, 2010 (edited) TLOTS,You do need to be logged in to download Just noticed on the image that you are - probably JohnOne has called it correctly. Here is what I downloaded from that link about 10 secs ago: expandcollapse popup;============================================================================================== ; Filename: Fileregister.au3 ; Author: this-is-me ;============================================================================================== ;============================================================================================== ; ; Description: FileRegister($ext, $cmd, $verb[, $def[, $icon = ""[, $desc = ""]]]) ; Registers a file type in Explorer ; Parameter(s): $ext - File Extension without period eg. "zip" ; $cmd - Program path with arguments eg. '"C:\test\testprog.exe" "%1"' ; (%1 is 1st argument, %2 is 2nd, etc.) ; $verb - Name of action to perform on file ; eg. "Open with ProgramName" or "Extract Files" ; $def - Action is the default action for this filetype ; (1 for true 0 for false) ; If the file is not already associated, this will be the default. ; $icon - Default icon for filetype including resource # if needed ; eg. "C:\test\testprog.exe,0" or "C:\test\filetype.ico" ; $desc - File Description eg. "Zip File" or "ProgramName Document" ; ;=============================================================================================== Func FileRegister($ext, $cmd, $verb, $def = 0, $icon = "", $desc = "") $loc = RegRead("HKCR\." & $ext, "") If @error Then RegWrite("HKCR\." & $ext, "", "REG_SZ", $ext & "file") $loc = $ext & "file" EndIf $curdesc = RegRead("HKCR\" & $loc, "") If @error Then If $desc <> "" Then RegWrite("HKCR\" & $loc, "", "REG_SZ", $desc) EndIf Else If $desc <> "" And $curdesc <> $desc Then RegWrite("HKCR\" & $loc, "", "REG_SZ", $desc) RegWrite("HKCR\" & $loc, "olddesc", "REG_SZ", $curdesc) EndIf If $curdesc = "" And $desc <> "" Then RegWrite("HKCR\" & $loc, "", "REG_SZ", $desc) EndIf EndIf $curverb = RegRead("HKCR\" & $loc & "\shell", "") If @error Then If $def = 1 Then RegWrite("HKCR\" & $loc & "\shell", "", "REG_SZ", $verb) EndIf Else If $def = 1 Then RegWrite("HKCR\" & $loc & "\shell", "", "REG_SZ", $verb) RegWrite("HKCR\" & $loc & "\shell", "oldverb", "REG_SZ", $curverb) EndIf EndIf $curcmd = RegRead("HKCR\" & $loc & "\shell\" & $verb & "\command", "") If Not @error Then RegRead("HKCR\" & $loc & "\shell\" & $verb & "\command", "oldcmd") If @error Then RegWrite("HKCR\" & $loc & "\shell\" & $verb & "\command", "oldcmd", "REG_SZ", $curcmd) EndIf EndIf RegWrite("HKCR\" & $loc & "\shell\" & $verb & "\command", "", "REG_SZ", $cmd) If $icon <> "" Then $curicon = RegRead("HKCR\" & $loc & "\DefaultIcon", "") If @error Then RegWrite("HKCR\" & $loc & "\DefaultIcon", "", "REG_SZ", $icon) Else RegWrite("HKCR\" & $loc & "\DefaultIcon", "", "REG_SZ", $icon) RegWrite("HKCR\" & $loc & "\DefaultIcon", "oldicon", "REG_SZ", $curicon) EndIf EndIf EndFunc ;==>FileRegister ;=============================================================================== ; ; Description: FileUnRegister($ext, $verb) ; UnRegisters a verb for a file type in Explorer ; Parameter(s): $ext - File Extension without period eg. "zip" ; $verb - Name of file action to remove ; eg. "Open with ProgramName" or "Extract Files" ; ;=============================================================================== Func FileUnRegister($ext, $verb) $loc = RegRead("HKCR\." & $ext, "") If Not @error Then $oldicon = RegRead("HKCR\" & $loc & "\shell", "oldicon") If Not @error Then RegWrite("HKCR\" & $loc & "\DefaultIcon", "", "REG_SZ", $oldicon) Else RegDelete("HKCR\" & $loc & "\DefaultIcon", "") EndIf $oldverb = RegRead("HKCR\" & $loc & "\shell", "oldverb") If Not @error Then RegWrite("HKCR\" & $loc & "\shell", "", "REG_SZ", $oldverb) Else RegDelete("HKCR\" & $loc & "\shell", "") EndIf $olddesc = RegRead("HKCR\" & $loc, "olddesc") If Not @error Then RegWrite("HKCR\" & $loc, "", "REG_SZ", $olddesc) Else RegDelete("HKCR\" & $loc, "") EndIf $oldcmd = RegRead("HKCR\" & $loc & "\shell\" & $verb & "\command", "oldcmd") If Not @error Then RegWrite("HKCR\" & $loc & "\shell\" & $verb & "\command", "", "REG_SZ", $oldcmd) RegDelete("HKCR\" & $loc & "\shell\" & $verb & "\command", "oldcmd") Else RegDelete("HKCR\" & $loc & "\shell\" & $verb) EndIf EndIf EndFunc ;==>FileUnRegisterM23Edit: Obvious! Edited July 22, 2010 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Share this post Link to post Share on other sites
JohnOne 1,603 Posted July 22, 2010 Probably doent have enough posts to access it. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
TLOTS 0 Posted July 22, 2010 Many thanks for your help! Share this post Link to post Share on other sites
z3r0c00l12 1 Posted October 22, 2010 (edited) Thanks Melba, Link in FAQ still down and I'm getting the same error as TLOTS: An Error Occurred Sorry, an error occurred. If you are unsure on how to use a feature, or don't know why you got this error message, try looking through the help files for more information. [#10171] You do not have permission to view this attachment. I've included the code Melba posted in an .au3, I've also updated the link in the FAQ. I am not the author of the code. FileRegister.au3 Edited October 22, 2010 by z3r0c00l12 Share this post Link to post Share on other sites
GrowBigTrees 0 Posted April 29, 2012 Thanks Melba & z3r0c00I12 ! Share this post Link to post Share on other sites