Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Admin Template - one policy for multiple registry keys

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
I'm trying to write an admin template to associate a file type with a certain application (for some reason it was changed to open with WinZip instead which is wrong). I just want to create one policy that says "Associate .xxx with This Application" but the problem is that it needs to write values to 2 different keys under HKCU (one is a sub-key of the other). From what I can see, a policy can only write one value to the registry, even with parts, they must be contained withint the same key. Does anyone know of any way around this?

Irish Poetry - Karen O'Connor
Get your Irish Poetry Published
Garten und Landschaftsbau
 
you could apply a VBScript as a logon script (in GPO: User Configuration\Windows Settings\Scripts Logon/Logoff) for your users. I've got a VBScript that changes a users ".doc" file association type to the Microsoft Word Viewer (instead of the default Microsoft Word)

this is it.....

Const HKEY_CURRENT_USER = &H80000001

strComputer = "."

Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath

strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.doc"
strValueName = "Application"
strValue = "WORDVIEW.EXE"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

this works nicely. let me know if your'e not clear on any of this. good luck
 
Thanks for the reply Dublin, but we already have a massive logon script that takes ages to run (which I'm trying to convince my manager to eliminate !!) so if possible I'd prefer do it through an admin template. Also, I'm curious about my initial question of having one policy write to multiple registry keys - just so I know for again.

Thanks again for your post :)

Irish Poetry - Karen O'Connor
Get your Irish Poetry Published
Garten und Landschaftsbau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top