Dobby Posted January 25, 2005 Share Posted January 25, 2005 I just did a search for File Extensions and did not get the following page listed in the results:Registering File Extensions Unattended (Fortunately, I had it in my history so I was able to get the link).Anyway, I was looking at this post and comparing it with the alternative method:Gosh's Unattended Tips And Tricks: Trick #3: Associate file typesTo me, using the ASSOC command and FTYPE seems to be a cleaner way of doing it than lots of registry stuff.I'd like to know ppls opinions on this. Is there a prefered method? Link to comment Share on other sites More sharing options...
prathapml Posted January 25, 2005 Share Posted January 25, 2005 One thing you have to know, is the "assoc" command will work only for registered programs. So if you already have registered apps, associating the extensions is TEN TIMES easier (and better) to do via assoc.If you are starting from a situation where you KNOW that your app doesn't already have any entries in the registry, and its YOU who has to do it all, then the .REG method is good. Link to comment Share on other sites More sharing options...
Dobby Posted January 25, 2005 Author Share Posted January 25, 2005 Could you clarify 'registered' program?As a test I took my favorite editor (EditPlus) and copied it to my Clean VPC install.I then did the following:C:\>ftype editplus=c:\editplus\editplus.exe %1 %*editplus=c:\editplus\editplus.exe %1 %*C:\>assoc .txt=editplus.txt=editplusI then double-clicked a txt file and viola! it loaded EditPlus with the txt file. Have I missed something? Icons maybe? Link to comment Share on other sites More sharing options...
prathapml Posted January 25, 2005 Share Posted January 25, 2005 C:\>ftype editplus=c:\editplus\editplus.exe %1 %*editplus=c:\editplus\editplus.exe %1 %*Yep, that was sort of what I meant by "registered".If you are comfortable with batch-files, it is far easier to do it that way. Dump the .reg way. Oh, and its a good idea to NOT use absolute paths. Always use system variables. For example, ftype editplus=c:\editplus\editplus.exe %1 %* ----> is not goodftype editplus=%systemroot%\editplus\editplus.exe %1 %* ---> is goodAlso, if you are able to use this method itself for all associating all your extensions, then announce your findings in the "Registering File Extensions Unattended (REG)" thread. Probably they might be interested to move over to a less-complex method. Link to comment Share on other sites More sharing options...
SiMoNsAyS Posted January 26, 2005 Share Posted January 26, 2005 what @prathapml tried to say is that you can't associate the file extension with a value that doesn't exist. that means that program need to be already installed and the value that you associate with the extension HAVE to exist. Link to comment Share on other sites More sharing options...
Dobby Posted January 26, 2005 Author Share Posted January 26, 2005 Oh, and its a good idea to NOT use absolute paths. Always use system variables.Oh of course it was only an example my scripts never have absolute paths in. Sorry I should follow the rules ALL the time. Call myself a programmer. Pah! Slap those wrists Link to comment Share on other sites More sharing options...
Dobby Posted January 26, 2005 Author Share Posted January 26, 2005 Well, thanks guys for the info. I don't see any reason why the extensions can't be applied after the relevant application is installed and personally I think it's a neater way to apply the associations. What's really nice is that these commands by themselves (without any parameters) list all the associations which is much easier to read than the registry.I'll make any issues I come across known. Thanks again. Link to comment Share on other sites More sharing options...
sleepnmojo Posted January 26, 2005 Share Posted January 26, 2005 I used to do the assoc/ftype way of doing things. I've since moved to an inf to add registry keys. Only reason is that it provides much more power in what I can do. Such as changing icons, adding menu extensions for certain file types, etc. If you are JUST looking for a quick and dirty way to associate extensions do the assoc way, but when you need to do more stuff with them, go the registry way. Link to comment Share on other sites More sharing options...
Dobby Posted January 26, 2005 Author Share Posted January 26, 2005 Thanks sleepnmojo that's what I thought. I'll let you know what I decide. Link to comment Share on other sites More sharing options...
clavicle Posted June 17, 2005 Share Posted June 17, 2005 I am associting the files using a batch file. Can someone please guide me what is the error in my bat file, because the files with long names (or spaces) do not open, especially in vlc player?assoc .dat=VCDMovie ftype VCDMovie="%programfiles%\vlc\vlc.exe" %%1 %%* Like a file "c:\Music\My videos\my saved video.dat" doesn't open in VLC, but a file without name space can be opened. Link to comment Share on other sites More sharing options...
benners Posted June 18, 2005 Share Posted June 18, 2005 @clavicleTry adding quotes around %%1 Link to comment Share on other sites More sharing options...
clavicle Posted June 18, 2005 Share Posted June 18, 2005 (edited) Thanks a lot benners, it worked! Edited June 18, 2005 by clavicle Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now