Jump to content

File Extension Assoiciation


Guest Guidosoft
 Share

Recommended Posts

Guest Guidosoft

http://www.autoitscript.com/fileman/users/public/Guidosoft/fileextass.au3

um, that is called a link. You click on it. LOL.

Yep, I made another script.

I have heard alot of people in the forums that can't be bothered with the systems registry and yet they complain of being unable to associate files from within a script. NO OFFENSE. I AM HERE TO HELP.

This is a VERY simple script. It does all of that for you. Although it is not alot.

Just use the commands to create new file types, add new items to the menu, set it's icon, delete file types, add to new menu(Sometimes doesn't work with newly created file types on my comp anyway for some f*** up reason.

So if ur need it then use it. A listing of the commands and how to use them is in the comments of my script. You just include it and use it. I trust that all of you know how to do so.

But for newbies just in case:

#Include "FileExtAss.AU3"

Stop laughing just because it says ass at the end.

Link to comment
Share on other sites

Warning: If you download and/or include this, comment line 18:

FileTypeDestroy("PIS")

If you don't it'll delete the .pis extension, though it doesn't appear that any programs use this, it sure as hell shouldn't be in a incude file!

Edit: Other than that, this looks like a very handy include and I'll be saving it in case I need it later...

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Guest Guidosoft

Warning:  If you download and/or include this, comment line 18:

FileTypeDestroy("PIS")

If you don't it'll delete the .pis extension, though it doesn't appear that any programs use this, it sure as hell shouldn't be in a incude file!

Edit: Other than that, this looks like a very handy include and I'll be saving it in case I need it later...

<{POST_SNAPBACK}>

Holy crap. Sorry I was testing it and I put that. Oops. Forgot to get rid of it.
Link to comment
Share on other sites

Holy crap. Sorry I was testing it and I put that. Oops. Forgot to get rid of it.

<{POST_SNAPBACK}>

LOL. cool nuff, just change the file on the server so someone doesn't loose an association :ph34r:

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

Guest Guidosoft

LOL.  cool nuff, just change the file on the server so someone doesn't loose an association :ph34r:

<{POST_SNAPBACK}>

As long as you didn't screw with the code that's perfectly fine by me.
Link to comment
Share on other sites

Guest Guidosoft

I'm not going to mess with your stuff, I'm suggesting you fix it.

<{POST_SNAPBACK}>

oh, sorry, I thaught that you said that you fixed it. Sorry. Lol. I'll go fix that pronto.
Link to comment
Share on other sites

  • 9 years later...

Seriously? You actually posted that? After the last two responses to this thread you'd think you would have realized that this thread is 10 years old, and the original poster isn't even a member any longer.

Think before you post next time, or at least read before you do.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

  • Moderators

tonycst,

 

Dont matter to me

Well it does to me - so please do not necro-post like this again. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • 1 year later...

Just for the reference I'm posting original script because it's useful and I have its copy on my disk and another member asked this:

;Script: FileExtAss.AU3 (File extension asscoiation)
;Author: Guido Arbia
;Version: 1.0
;Function: Include file that allows people to easily assoicate file extensions and add menu options to it and junky like thato.

;Commands:
;IMPORTANT!: DO NOT INCLUDE THE (.) IN THE FILE EXTENSION!!!
;FileTypeCreate($Extension,$Description) - Creates a new file type.
;FileTypeDestroy($Extension) - Totaly kills an existing file type.
;FileTypeAddToNew($Extension) - Add file type to the new menu.
;FileTypeRemoveFromNew($Extension) - Remove file from new menu.
;FileTypeAddMenOpt($Extension,$ItemText,$Command) - Adds a item to the menu duh.
;FileTypeRemoveMenOpt($Extension,$ItemText) - If you don't know what this does your a moron.
;FileTypeSetIcon($Extension,$IconFile) - Uh... DUH!!!!!!

$RootKey = "HKEY_CLASSES_ROOT\"

Func FileTypeCreate($Extension,$FileType)
   $ExtKey = $RootKey & "." & $Extension
   $FileKey = $RootKey & $Extension & "File"
   RegWrite($ExtKey,"","REG_SZ",$Extension & "File")
   RegWrite($FileKey,"","REG_SZ",$FileType)
EndFunc

Func FileTypeDestroy($Extension)
   $ExtKey = $RootKey & "." & $Extension
   $FileKey = $RootKey & RegRead($ExtKey, "")
   RegDelete($ExtKey)
   RegDelete($FileKey)
EndFunc

Func FileTypeAddToNew($Extension)
   $ExtKey = $RootKey & "." & $Extension
   RegWrite($ExtKey & "\ShellNew","NullFile","REG_SZ","")
EndFunc

Func FileTypeRemoveFromNew($Extension)
   $ExtKey = $RootKey & "." & $Extension
   RegDelete($ExtKey & "\ShellNew")
EndFunc

Func FileTypeAddMenOpt($Extension,$ItemText,$Command)
   $ExtKey = $RootKey & "." & $Extension
   $FileKey = $RootKey & RegRead($ExtKey, "")
   $ShellKey = $FileKey & "\Shell"
   RegWrite($ShellKey &"\" & $ItemText,"","REG_SZ",$ItemText)
   RegWrite($ShellKey &"\" & $ItemText & "\Command", "", "REG_SZ",$Command)
EndFunc

Func FileTypeRemoveMenOpt($Extension,$ItemText,$Command)
   $ExtKey = $RootKey & "." & $Extension
   $FileKey = $RootKey & RegRead($ExtKey, "")
   $ShellKey = $FileKey & "\Shell"
   RegDelete($ShellKey &"\" & $ItemText)
EndFunc

Func FileTypeSetIcon($Extension,$Icon)
   $ExtKey = $RootKey & "." & $Extension
   $FileKey = $RootKey & RegRead($ExtKey, "")
   $ShellKey = $FileKey & "\DefaultIcon"
   RegWrite($ShellKey,"","REG_SZ",$Icon)
EndFunc

 

Edited by Zedna
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...