I want to create a script that will set the file associations for mostly MS Office files and a few other files extensions to the local applications (they would currently be through citrix). I am planning on using a simple Batch file.
However I would like it to be able to detect whether the filetype is valid and create it if not using ftype. I would also like it to be able to detect/differentiate between whether the user has MS Office 2003 or MS Office 2007 and associate accordingly.
My question is, will a Batch file be able to do all this, or am I better off using something else like a vb script (taking into account I know NO vb, although I’m pretty novice with Batch files too)??
Any help is appreciated
EDIT: I should have bee clearer that this is in a locked down environment, so no direct registry editoring can be done, and it will need to be available to users, from a shared drive or something similiar.
A batch file alone can’t detect if the file association is correct, but you could just fire the batch file everytime anyway, forcing the file association to be correct. It’ll just overwrite what’s already there.
Just create the proper associations yourself, then run Regedit and export a .reg file containing the association keys, and use a batch file that runs regedit to import the keys. Probably /import or somesuch – I rarely use Windows anymore!
Here’s a page that explains it:
http://www.robvanderwoude.com/regedit.php