| Change file Associations with scripting |
|
|
| Written by Hans Straat, Tuesday, 03 October 2006 | |
|
Sometimes you get the chalange that you have to change file associations for all users in your windows environment. This can be either a local workstation, on a plain terminal server or a citrixfarm wide change. Most of the system engineers now the programs accoc or ftype. Type these commands in your command prompt with the /? parameter and you get all options. But heck, what if you need to do this for about 1000 users in there own user registryhyve? Since I know sh*t of programming I looked realy Marc wrote a script that let's you change file associations for all users or simply a single user if used in other logon scripts.
The vbs script marc wrote uses a few parameters. First comes the scriptname.vbs [used filetype] [used extension] [ full path to executable] This would look like the example Example: SetFileAssociations.vbs phpfile .php "c:\program files\php\php.exe" We provide you with a scripting solution that is made for my citrixfarm but heck why not give it to everybody that strugles with changing filetypes. The script Copy paste this in your notepad or what editor you use and preferly save it as SetFileAssociates.vbs if you have comments on the script register on this site and write your comments. We use version control on scripts so if this script is updated a new script will be posted according to the version. '-------------------------------------------------------------------------------
'-----------------------------------------------------------------------
dim objArgs
'-----------------------------------------------------------------------
'----------------------------------------------------------------------- shObj.RegWrite STR_KEY & strFileType & "\Shell\Open\Command\", """" & strFilePath & """", "REG_SZ" 'end script Note: Have fun with this script, usage is free of charge |
| < Prev | Next > |
|---|

