Ok, figured I would throw this one up as well, and I think this is the correct thread. If not, sorry, and its cool to move.

VB version: 6

Ok, this is what is going on. I am trying to write a VBS that will:

1) Detect what version of outlook you are running
2) Over write a specified file with a diffrent specified file (on a server) depending on what version of Outlook you are running

Current Progress:

We where using a old script that was like this, back when a single "normal.dot" was all we needed. This simply overwrote the old normal.dot with the one that was hosted on a server. It also closed out any running version of Outlook and Word that was running.

Code:
@echo off
echo Please save any documents in Microsoft Word or Outlook before proceeding.
echo *************************************************************************
pause
echo This will take a few seconds

rem ** The following will force kill processes for Microsoft Word and Outlook **
C:\WINDOWS\SYSTEM32\TASKKILL.EXE /f /im WINWORD.exe
C:\WINDOWS\SYSTEM32\TASKKILL.EXE /f /im OUTLOOK.exe

rem ** The following will overwrite the local normal.dot file **
copy /y "\\server\normal.dot" "%USERPROFILE%\Application Data\Microsoft\Templates\"
Then we also had a script that we used that detected what version of outlook you where using via regkeys, and it would detect to see if you have a particular regkey we needed, and if you didn't, it created it.

Code:
'    OutlookDelegateWastebasketchange.vbs
'    
'   
'    This script will determine if the Outlook installation is 2k, 2k2, 2k3, or 2k7
'    And will add / change the DelegateWastebasketStyle reg key in the approproate
'    registry path depending upon the Outlook version.

 
Dim WSHShell, checkdspKey, outook2000ver, outlook2002ver, outlook2003ver, outlook2007ver, otherVersion
Set objShell = WScript.CreateObject("WScript.Shell")

'  If any regread fails, continue executing

On Error Resume Next

'   Check to see if this script has the block key
'   If the block key is entered, end script


RegKey = objShell.regread("HKCU\Software\DarksideProductions\Outlook\DelegateWasteBasket_block")
  

'  set the checkdspKey variable based on the regread outcome

 if Err.Number then 
    checkdspKey = "1"
    else checkdspKey = "2" 
 end if

'  Log that nothing will be changed

if checkdspKey = "2" then
WScript.echo "****DSP Block Key detected, script exiting****"
end if

'  Quit the script

if checkdspkey = "2" then
WScript.Quit
end if


'  Change / add the key depending upon the Outlook version detected


'  Outlook 2007 Script

On Error Resume Next

RegKey = objShell.regread("HKCU\Software\Microsoft\Office\12.0\Outlook\Options\General\Security Zone")
  
 if Err.Number then
    outlook2007ver = "0"
    else
    objShell.RegWrite "HKCU\Software\Microsoft\Office\12.0\Outlook\Options\General\DelegateWastebasketStyle", 4, "REG_DWORD"
    outlook2007ver = "1"
  end if

On Error Resume Next

'  Outlook 2003 Script

RegKey = objShell.regread("HKCU\Software\Microsoft\Office\11.0\Outlook\Options\General\Security Zone")
  
 if Err.Number then
    outlook2003ver = "0"
    else
    objShell.RegWrite "HKCU\Software\Microsoft\Office\11.0\Outlook\Options\General\DelegateWastebasketStyle", 4, "REG_DWORD"
    outlook2003ver = "1"
  end if

On Error Resume Next

'  Outlook 2002 Script

RegKey = objShell.regread("HKCU\Software\Microsoft\Office\10.0\Outlook\Options\General\Security Zone")
  
 if Err.Number then
    outlook2002ver = "0"
    else
    objShell.RegWrite "HKCU\Software\Microsoft\Office\10.0\Outlook\Options\General\DelegateWastebasketStyle", 4, "REG_DWORD"
    outlook2002ver = "1" 
 end if

On Error Resume Next

'  Outlook 2000 Script

'   For Outlook 2k, we check a different key for the presence of Outlook due to inconsistent registry
'   appearance on the terminal servers.  

RegKey = objShell.regread("HKCU\Software\Microsoft\Office\9.0\Outlook\Options\MSHTML\International\LastIEVersion")
  
 if Err.Number then
    outlook2000ver = "0"
    else
    objShell.RegWrite "HKCU\Software\Microsoft\Office\9.0\Outlook\Options\General\DelegateWastebasketStyle", 4, "REG_DWORD"
    outlook2000ver = "1" 
  end if

'  If none of the three keys are found, log the following info and quit

otherVersion = "0"

 if outlook2007ver = "1" then
  otherVersion= "1"
 end if
 
 if outlook2003ver = "1" then
  otherVersion = "1"
 end if

 if outlook2002ver = "1" then
  otherVersion = "1"
 end if

 if outlook2000ver = "1" then
  otherVersion = "1"
 end if

 if otherVersion = "0" then
   WScript.echo "Client is not running Outlook 2000, 2002, 2003, 2007, or has not setup email yet."
   WScript.Quit
 end if

 
'  log the key update and apparent Outlook version

if outlook2000ver = "1" then
WScript.echo "Client appears to be running Outlook 2000"
end if

if outlook2002ver = "1" then
WScript.echo "Client appears to be running Outlook 2002"
end if

if outlook2003ver = "1" then
WScript.echo "Client appears to be running Outlook 2003"
end if

if outlook2007ver = "1" then
WScript.echo "Client appears to be running Outlook 2007"
end if

if checkdspKey = "1" then
WScript.echo "Updated DelegateWastebaskey Reg Key"
end if

WScript.Quit(0)
This worked wonderfually for what we needed it for.

Issue: I have been trying to kinda combine these codes to some extent to detact what version of outlook you where running to make sure it over wrote the correct version of the normal.dot. So far, no luck. Anyone got any ideas?