thepriest
Habitué
Bonjour à tous,
Voilà je suis en train de créer un petit VBS qui permet de controler la verison de Microsoft Office97 présente sur des pc sous NT4.
Le problème n'est pas le script en lui même vu qu'il fonctionne, je l'ai testé. mais le vrai noeud du problème est de connaître les versions existante de Ms Office97.
En effet, il y a au moins 4 versions:
- Office97 vierge de patch
- Office97 SR1
- Office97 SR2
- Office97 SR2a
- Office97 SR2b (1122)
Ce que j'aurai souhaité c'est disposer d'une liste complète des versions ayant existées, mais j'ai beau avoir chercher chez MS (MSDN et SDK), je n'y suis pas parvenu
[fixed]
'*****************************************
'
' This vbs is used to know the version of
' the release of ' the Microsoft office97
' installed in NT computers.
'
' Pay attention this script run only for
' computer under NT & MsOffice97
'
'*****************************************
' Turn error detection off
On Error Resume Next
Dim strComputer, strSubKey, ValueName, ValueVersion, ValueVersionExt, ValueFullName1, ValueFullName2
Dim strDisplayValue , cpt
Dim strRegKey1
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strOldName = objReg.RegRead(strRegKey1)
'****************************************************************
' Modify the strRegKey1 to verify the registry you want to check
' and don't remember to modify the ValueName
'****************************************************************
strRegkey1 = "SOFTWARE\Microsoft\MS Setup (ACME)\Table Files"
ValueFullName1 = "MS Office 97 Professional@v97.0.0.1122(1033)"
'ValueFullName2 = "MS Office 97 Professional@v97.0.0.1117(1033)"
'ValueFullName3 = "MS Office 97 Professional@v97.0.0.1114(1033)"
'With this method we build the ValueFullName thus is dynamic with an inputbox
'ValueFullName = ValueName & InputBox ("Please put the version of Microsoft Office97 you want to check", "Version : ") & ValueVersionExt
If Err.Number <> 0 Then
' Key existed
' Capture the information
Set objRegistry = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strRegKey1, arrSubKeys
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
strRegKey1 , ValueFullName1, strDisplayValue
'Place here the select case proposale when
'we have all the Office97 version
'Select Case someVariable
'Case "something"
'do some code
'Case "somethingelse"
'do a diferent line of code
'Case Else
'do a default statement
'End Select
If strDisplayValue <> "" Then
MsgBox("Key present !" & vbcrlf & "You have a Microsoft Office97 RC2 installed" )
Else
MsgBox("Key does not exist")
End If
strDisplayValue = vbEmpty
Else
' Key did not exist
MsgBox("Key does not exist")
End If
' Turn error detection back on
On Error Goto 0
[/fixed]
En attendant une réponse d'une personne qui a la connaissance, passez une bonne journée/soirée
Voilà je suis en train de créer un petit VBS qui permet de controler la verison de Microsoft Office97 présente sur des pc sous NT4.
Le problème n'est pas le script en lui même vu qu'il fonctionne, je l'ai testé. mais le vrai noeud du problème est de connaître les versions existante de Ms Office97.
En effet, il y a au moins 4 versions:
- Office97 vierge de patch
- Office97 SR1
- Office97 SR2
- Office97 SR2a
- Office97 SR2b (1122)
Ce que j'aurai souhaité c'est disposer d'une liste complète des versions ayant existées, mais j'ai beau avoir chercher chez MS (MSDN et SDK), je n'y suis pas parvenu
[fixed]
'*****************************************
'
' This vbs is used to know the version of
' the release of ' the Microsoft office97
' installed in NT computers.
'
' Pay attention this script run only for
' computer under NT & MsOffice97
'
'*****************************************
' Turn error detection off
On Error Resume Next
Dim strComputer, strSubKey, ValueName, ValueVersion, ValueVersionExt, ValueFullName1, ValueFullName2
Dim strDisplayValue , cpt
Dim strRegKey1
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strOldName = objReg.RegRead(strRegKey1)
'****************************************************************
' Modify the strRegKey1 to verify the registry you want to check
' and don't remember to modify the ValueName
'****************************************************************
strRegkey1 = "SOFTWARE\Microsoft\MS Setup (ACME)\Table Files"
ValueFullName1 = "MS Office 97 Professional@v97.0.0.1122(1033)"
'ValueFullName2 = "MS Office 97 Professional@v97.0.0.1117(1033)"
'ValueFullName3 = "MS Office 97 Professional@v97.0.0.1114(1033)"
'With this method we build the ValueFullName thus is dynamic with an inputbox
'ValueFullName = ValueName & InputBox ("Please put the version of Microsoft Office97 you want to check", "Version : ") & ValueVersionExt
If Err.Number <> 0 Then
' Key existed
' Capture the information
Set objRegistry = GetObject("winmgmts:" & _
"{impersonationLevel=Impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
objRegistry.EnumKey HKEY_LOCAL_MACHINE, strRegKey1, arrSubKeys
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, _
strRegKey1 , ValueFullName1, strDisplayValue
'Place here the select case proposale when
'we have all the Office97 version
'Select Case someVariable
'Case "something"
'do some code
'Case "somethingelse"
'do a diferent line of code
'Case Else
'do a default statement
'End Select
If strDisplayValue <> "" Then
MsgBox("Key present !" & vbcrlf & "You have a Microsoft Office97 RC2 installed" )
Else
MsgBox("Key does not exist")
End If
strDisplayValue = vbEmpty
Else
' Key did not exist
MsgBox("Key does not exist")
End If
' Turn error detection back on
On Error Goto 0
[/fixed]
En attendant une réponse d'une personne qui a la connaissance, passez une bonne journée/soirée