Link to home
Start Free TrialLog in
Avatar of DubberDan
DubberDanFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Changing file extension association via group policy

I'm trying to roll out a change of file extension association across the network which is running with a Windows 2000 server running AD.

I've followed the steps in this question:

https://www.experts-exchange.com/questions/21270787/group-policy-to-control-winxp-file-extension-association.html?sfQueryTermInfo=1+associ+extens+file+group+polici+set

But it only explains how to add an extension, not how to set it to use a particular program.

Is this possible via a group policy, or perhaps by a custom registry setting that is pushed out by a policy?

Any help would be greatly appreciated and it's quite urgent this one too, so plenty of points available.
Avatar of matrixnz
matrixnz

It's best to capture this from within the registry and import it directly using login script or by creating a custom ADM file.  The extension information is held in the registry under HKEY_Classes.

Hope that helps.

Cheers
Avatar of DubberDan

ASKER

That's given me something to go with, but do you have any further details to help me along the way?
Can you tellus the extensions you're trying to create?

Cheers
The extension is TIF (rather than TIFF) and is used by a document management program for it's custom viewer.  I got the location for the appropriate .exe but just cam't see a way to browse to find it and associate it.
Download RegShot http://www.snapfiles.com/get/regshot.html

Take the first shot of the registry

Now right click on the TIF file and select Open With
Browse to the program or select the program from the list of programs available.
Click Apply - OK

Take the second shot of the registry and than click Compare

You should now see what registry changes were created, you than can create a .reg file to be imported via a login script for e.g. regedit /s \\share\tifext.reg

Hope that helps.

Cheers
Thanks for that, but unfortunately Regshot is not currently available to download from that site.  There is another listing for the program when searching on Google at http://regshot.blog.googlepages.com but I don't know if that's a safe download.

Do you know if that one would be safe, or whether there's somewhere else to download it?
You can use "RegMon" (freeware) to capture registry changes (use the filter to precise result)

Download it from Microsoft site:
http://www.microsoft.com/technet/sysinternals/utilities/regmon.mspx
Hi Dubberdan

RegMon will be fine as well

http://regshot.blog.googlepages.com/regshot is the developers site for regshot, strange it went down on snapfiles as I only downloaded a copy from there last Monday while I was away from own system and needed to capture some registry keys.  The reason I use regshot is that it doesn't require any installation i.e you can run it directly from a USB key etc..

Also noted on the developers website a couple of extensions that will create your reg file for you, which would be very handy.

Cheers
Ok that's cool.  I'll give RegShot a go then.

If I need to make changes to both Windows 2000 and Win XP pc's, will the registry entries be the same or are they likely to be different?
I've just had a look at the extension but it doesn;t seem to do anything different to the normal version.

So can you give me an idea of how to create the custom reg file?
Hi DubberDan

Q. If I need to make changes to both Windows 2000 and Win XP pc's, will the registry entries be the same or are they likely to be different?
A. 99.9% cases no, the only difference usually is if the program being used is stored under the Winnt (2000) or Windows (XP) although this is usually highly unlikely.

Q. So can you give me an idea of how to create the custom reg file?
A. Sure

1. Copy the following text into Notepad and Save it with a .reg extension.
(Note: to save in NotePad as a .reg you'll need to change "Save as type:" from Text Documents to All Files)

--- Copy Start Here ---
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.tif]
"Content Type"="image/jpeg"
@="Fireworks.tiff"
"PerceivedType"="image"

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document]

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document\ShellNew]

[HKEY_CLASSES_ROOT\.tif\OpenWithList]

[HKEY_CLASSES_ROOT\.tif\OpenWithList\ois.exe]
@=""

[HKEY_CLASSES_ROOT\.tif\PersistentHandler]
@="{58F2E3BB-72BD-46DF-B134-1B50628668FB}"
--- Copy End Here ---

The information above is what I use for .tif files, in your regshot comparison you should note something very similar, all you need to do is make the changes to the reg file above, by modifying the contents.  If you need feel free to copy the contents of your compare file here.

Cheers
thanks again.  i'll have to give it a whirl over the weekend now.
Been one of those weeks it seems, so only just getting round to it now!

Here's my compare file:

----------------------------------
Values added:18
----------------------------------
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\Application: "SAWF_STUB.exe"
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\MinPos1024x768(1).x: 0xFFFF8300
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\MinPos1024x768(1).y: 0xFFFF8300
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\MaxPos1024x768(1).x: 0xFFFFFFFF
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\MaxPos1024x768(1).y: 0xFFFFFFFF
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\WinPos1024x768(1).left: 0x000000DC
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\WinPos1024x768(1).top: 0x00000016
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\WinPos1024x768(1).right: 0x000003FC
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\WinPos1024x768(1).bottom: 0x0000026E
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\Rev: 0x00000000
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\WFlags: 0x00000002
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\ShowCmd: 0x00000001
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\FFlags: 0x00000000
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\HotKey: 0x00000000
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\Buttons: 0xFFFFFFFF
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\Links: 0x00000000
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\Address: 0xFFFFFFFF
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\Bags\103\Shell\Vid: "{137E7700-3573-11CF-AE69-08002B2E1262}"

----------------------------------
Values modified:3
----------------------------------
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\9040110900063D11C8EF10054038389C\Usage\OutlookMAPI2: 0x36F30074
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\9040110900063D11C8EF10054038389C\Usage\OutlookMAPI2: 0x36F3007C
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList\MRUList: "ba"
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList\MRUList: "ab"
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\BagMRU\0\MRUListEx: 02 00 00 00 01 00 00 00 00 00 00 00 03 00 00 00 05 00 00 00 04 00 00 00 FF FF FF FF
HKU\S-1-5-21-1659004503-1454471165-725345543-500\Software\Microsoft\Windows\ShellNoRoam\BagMRU\0\MRUListEx: 01 00 00 00 02 00 00 00 00 00 00 00 03 00 00 00 05 00 00 00 04 00 00 00 FF FF FF FF

----------------------------------
Total changes:21
----------------------------------

The relevant line I beleive is the one near the top that mentions "SAWF_STUB.exe" so would all I need to change be the ois.exe for that?
Any one?
Sorry DubberDan, been away for a few days haven't had to catchup, I'll write the reg file for you tomorrow, as it's late here and I'm about to hit the sack.

Cheers
That'll be great, many thanks.  Have a good kip ;-)
Hi DubberDan

Before I can continue I actually need a couple of things from you:
1. Is the program you wish to use registerd on the computer?  i.e. was it installed or is it just an executable?
2. When you ran regshot capture did you run this on a new machine? i.e. prior to associating the program aka a newly reimaged computer.
3. When you ran regshot capture did you use these steps:
 a. Run Regshot
 b. Click 1st shot
 c. Right Clicked .tif file
 d. Selected Open With > Choose Program
 e. Check Always use the selected program to open this kind of file.
 f. Click Browse...
 g. Select the correct Program
 h. Click Open
 i. Click OK

Once you confirm this I'll be able complete the reg file.  If you're unsure do you have that particular execuable available for download so I can verify the settings I give you work?  Although I could give you a registry key for importing, if that file is not registered correctly on the computer than it won't know where to find the executable, if you get my meaning.

Cheers
1. Yep it's an installed program used for document management for which a recent update has required a slightly different viewer to be used. Both the old and new viewer are located in the same folder on a server. So it's just the file association that needs chaning from one to the other

2. No it wasn't a newly imaged pc, but an existing pc.  Between snapshots I changed the file association.  I also ran it on our terminal server (Win 2k3) as we have some users that access the network at a remote site as well as our main one. The changes in that case were the same

3. Not quite. I went into Tools > Folder Options > File Types, then selected the .tif from the list and browsed to the location of the new program
Hi DubberDan

Would highly suggest redoing the snapshot on a clean machine using the steps I set out above.  The reason being, you need to make sure that SAWF_STUB.exe has been registered correctly.

Also please export the following three registry keys and post  them here.

1. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\
2. HKEY_CURRENT_USER\Software\Classes\Applications\
3. HKEY_CLASSES_ROOT\.tif\

Basically, we're trying to verify that the path etc.. to SAWF_STUB.exe are in place, otherwise the system won't know where to look for SAWF_STUB.exe if you get my meaning.

Cheers
Surely the only way to get a clean snapshot as you say is from a fresh imaged pc, something I'm not in a position to do.  It should be registered fine as there is a line in the login script that runs a reregdll batch file specifically for this program

Reg keys as requested, 1st from my laptop:

1.
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif]
"Progid"="TIFImage.Document"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList]
"a"="SAWFADO_IMG.exe"
"MRUList"="bdca"
"b"="mspaint.exe"
"c"="Photoshop.exe"
"d"="SAWF_STUB.exe"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithProgids]
"TIFImage.Document"=hex(0):
"Photoshop.TIFFFile.9"=hex(0):
"MSPaper.Document"=hex(0):
"PCTI Workflow File Viewer.Document"=hex(0):

2.
[HKEY_CURRENT_USER\Software\Classes\Applications]

[HKEY_CURRENT_USER\Software\Classes\Applications\7zFM.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\7zFM.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\7zFM.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\7zFM.exe\shell\open\command]
@="\"C:\\Program Files\\7-Zip\\7zFM.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\Acrobat.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\Acrobat.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\Acrobat.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\Acrobat.exe\shell\open\command]
@="\"C:\\Program Files\\Adobe\\Acrobat 6.0\\Acrobat\\Acrobat.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\cedt.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\cedt.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\cedt.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\cedt.exe\shell\open\command]
@="\"C:\\Program Files\\Crimson Editor\\cedt.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\PowerCinema.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\PowerCinema.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\PowerCinema.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\PowerCinema.exe\shell\open\command]
@="\"C:\\Program Files\\CyberLink\\PowerCinema\\PowerCinema.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell\open\command]
@="\"P:\\PCTI\\ScanAgent_WF\\SAWF_STUB.exe\" \"%1\""

[HKEY_CURRENT_USER\Software\Classes\Applications\Whorld.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\Whorld.exe\shell]
@="Open"

[HKEY_CURRENT_USER\Software\Classes\Applications\Whorld.exe\shell\Open]
@="Open"

[HKEY_CURRENT_USER\Software\Classes\Applications\Whorld.exe\shell\Open\command]
@="\"C:\\Program Files\\Whorld\\Whorld.exe\" \"%1\""
"command"=hex(7):60,00,3f,00,70,00,50,00,30,00,3f,00,4c,00,58,00,64,00,38,00,\
  29,00,25,00,77,00,54,00,56,00,4d,00,5e,00,35,00,39,00,48,00,3e,00,46,00,45,\
  00,4c,00,53,00,5e,00,36,00,28,00,56,00,6c,00,38,00,40,00,5d,00,40,00,57,00,\
  4a,00,26,00,7e,00,40,00,30,00,2c,00,20,00,22,00,25,00,31,00,22,00,00,00,00,\
  00



3.
[HKEY_CLASSES_ROOT\.tif]
"Content Type"="image/tiff"
@="PCTI Workflow File Viewer.Document"

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document]

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document\ShellNew]

[HKEY_CLASSES_ROOT\.tif\OpenWithList]

[HKEY_CLASSES_ROOT\.tif\OpenWithList\ois.exe]
@=""

and now from the terminal server:

1.
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif]
"Application"="SAWF_STUB.exe"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithList]
"a"="SAWF_STUB.exe"
"MRUList"="ab"
"b"="SAWFADO_IMG.exe"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.tif\OpenWithProgids]
"PCTI Workflow File Viewer.Document"=hex(0):


2.
[HKEY_CURRENT_USER\Software\Classes\Applications]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell\open]

[HKEY_CURRENT_USER\Software\Classes\Applications\SAWF_STUB.exe\shell\open\command]
@="\"P:\\PCTI\\ScanAgent_WF\\SAWF_STUB.exe\" \"%1\""


3.
[HKEY_CLASSES_ROOT\.tif]
"Content Type"="image/tiff"
@="MSPaper.Document"

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document]

[HKEY_CLASSES_ROOT\.tif\MSPaper.Document\ShellNew]

[HKEY_CLASSES_ROOT\.tif\OpenWithList]

[HKEY_CLASSES_ROOT\.tif\OpenWithList\ois.exe]
@=""



ASKER CERTIFIED SOLUTION
Avatar of matrixnz
matrixnz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Many thanks, looks ideal.  Will give it a whirl
Sorry for the slow reply, have been away for a bit.  Seems to have done the trick, so 500 points well earned!