Howdy,
What I’m tring to accomplish is this… A login VBScript runs, when a user logs in. The script changes the file association type of .doc files so that they open with the free Microsoft Word viewer, “Microsoft Office Word Viewer 2003”.
I want this to apply to end users based on Windows global groups. If the user is a member of a Windows domain global group called “MicrosoftWordViewer”, any Word documents (.doc files) that the user opens, will automatically launch with the “Microsoft Office Word Viewer 2003”.
I want to apply the same idea to Excel files with a “MicrosoftExcelViewer” Windows global group.
I’ve put together a script, which will make the Word and Excel viewers the default viewers for .doc and .xls files and it works nicely. This is the VBScript…
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
''''' Change the default viewer for Word files to Microsoft Office Word Viewer 2003
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
''''' Change the default viewer for Excel files to Microsoft Office Excel Viewer 2003
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xls"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xls"
strValueName = "Application"
strValue = "XLVIEW.EXE"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
That’s the easy bit. What I don’t know what to do is… make the script configure the Word and Excel viewers for a user only IF the user belongs to a specific global group. For example…
If user is a member of MicrosoftExcelViewer, all of his .xls documents will open with the “Microsoft Office Excel Viewer 2003”
If user is a member of MicrosoftWordViewer, all of his .doc documents will open with the “Microsoft Office Word Viewer 2003”
Any suggestions here would be much appreciated!
What I’m tring to accomplish is this… A login VBScript runs, when a user logs in. The script changes the file association type of .doc files so that they open with the free Microsoft Word viewer, “Microsoft Office Word Viewer 2003”.
I want this to apply to end users based on Windows global groups. If the user is a member of a Windows domain global group called “MicrosoftWordViewer”, any Word documents (.doc files) that the user opens, will automatically launch with the “Microsoft Office Word Viewer 2003”.
I want to apply the same idea to Excel files with a “MicrosoftExcelViewer” Windows global group.
I’ve put together a script, which will make the Word and Excel viewers the default viewers for .doc and .xls files and it works nicely. This is the VBScript…
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
''''' Change the default viewer for Word files to Microsoft Office Word Viewer 2003
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
''''' Change the default viewer for Excel files to Microsoft Office Excel Viewer 2003
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xls"
oReg.CreateKey HKEY_CURRENT_USER,strKeyPath
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xls"
strValueName = "Application"
strValue = "XLVIEW.EXE"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue
That’s the easy bit. What I don’t know what to do is… make the script configure the Word and Excel viewers for a user only IF the user belongs to a specific global group. For example…
If user is a member of MicrosoftExcelViewer, all of his .xls documents will open with the “Microsoft Office Excel Viewer 2003”
If user is a member of MicrosoftWordViewer, all of his .doc documents will open with the “Microsoft Office Word Viewer 2003”
Any suggestions here would be much appreciated!