IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

VBScript Discussion :

Inventaire Parc logiciel


Sujet :

VBScript

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Février 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 5
    Par défaut Inventaire Parc logiciel
    Bonjour à tous

    Je script une code permettant le lister les différente application sur un hote distant
    Plusieurs idées me vienne à l'esprit

    -Lire la base de registre
    ou
    - Se connecter à un hote distant par requete WMI
    Puis travailler sur l'objet Programme Files
    Puis Faire une fonction recursive qui analyse le sous rep ainsi que les fichier pour me retouner s'ils existent des . exe ou cmd

    Quelqu'un aurait une autre idée?

    De plus je voudrais généré un rapport final de mon inventaire logiciel un peu comme le fais actuellement l'outil Microsoft SMS 2003
    Quelqu'un connait il le fonctionnement de cet outil Comment remonte il ce rapport
    Par requete WMI ou par lecture de la base de registre .

    Merci d'avance pour votre aide

  2. #2
    Membre expérimenté
    Inscrit en
    Mai 2008
    Messages
    189
    Détails du profil
    Informations forums :
    Inscription : Mai 2008
    Messages : 189
    Par défaut
    j'ai trouvé un truc qui marche pour l'inventaire :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
     on error resume Next
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
    strComputer = env.Item("Computername")
    Const HKEY_LOCAL_MACHINE = &H80000002
    Const UnInstPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
    ".\root\default:StdRegProv")
    report = report & "******************************************" & vbCrLf
    report = report & " - Inventaire de l'ordinateur " & strComputer & " - " & vbCrLf
    report = report & "******************************************" & vbCrLf & vbCrLf
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
    report = report & vbCrLf & "******************************************" & vbCrLf
    report = report & "Informations sur Windows" & vbCrLf & "******************************************" & vbCrLf
    For Each objItem in colItems
        report = report &  "- Nom du poste: " & strComputer  & vbCrLf
        report = report &  "- Description de l'ordinateur: " & objItem.Description & vbCrLf
        report = report &  "- Utilisateur possédant la licence Windows: " & objItem.RegisteredUser & vbCrLf
        report = report &  "- Organisation possédant la licence Windows: " & objItem.Organization & vbCrLf
        report = report & "******************************************" & vbCrLf
        report = report &  "- Nom du système d'exploitation: " & objItem.Caption & vbCrLf
        If (objItem.OSProductSuite <> "")Then
            report = report &  "- Système d'exploitation de la suite " & objItem.OSProductSuite & vbCrLf
        End If
        report = report &  "- Version: " & objItem.Version & vbCrLf
        report = report &  "- Date de son installation: " & objItem.InstallDate & vbCrLf
        report = report &  "- Numéro de série de " & objItem.Caption & ": " & objItem.SerialNumber & vbCrLf
        report = report & vbCrLf
        report = report & "******************************************" & vbCrLf
        report = report & "Détails techniques sur Windows"& vbCrlf
        report = report & "******************************************" & vbCrLf
        report = report &  "- Numéro du dernier Service Pack majeur installé: "
        report = report & objItem.ServicePackMajorVersion & vbCrLf
        If (objItem.ServicePackMinorVersion<>0) AND (objItem.ServicePackMinorVersion<>"") Then
            report = report &  "- Numéro du dernier Service Pack mineur installé: " & objItem.ServicePackMinorVersion & vbCrLf
        End If
        report = report &  "- - - - - -" & vbCrLf
        report = report &  "Les Service Pack et les mises-à-jour de sécurité de Windows sont disponibles sur:" & vbCrLf
        report = report &  "===> http://windowsupdate.microsoft.com <===" & vbCrLf
        report = report &  "- - - - - -" & vbCrLf & vbCrLf
        'report = report &  "- Emplacements du système d'exploitation sur l'ordinateur: " & vbCrLf & objItem.Name & vbCrLf
        report = report &  "- Répertoire où Windows est installé: " & objItem.WindowsDirectory & vbCrLf
        report = report &  "- Niveau d'encryption des données: " & objItem.EncryptionLevel & " bits" & vbCrLf
        If (objItem.MaxNumberOfProcesses="-1") Then
            report = report &  "- Maximum de processus pouvant être ouvert: Aucune limite fixée" & vbCrLf
        Else
            report = report &  "- Maximum de processus pouvant être ouvert: " & objItem.MaxNumberOfProcesses & vbCrLf
        End If
    Next
    Set colBaseBoards =  objWMIService.ExecQuery _
        ("Select * from Win32_BaseBoard")
    report = report & vbCrLf & "******************************************" & vbCrLf
    report = report & "Carte-mère" & vbCrLf & "******************************************" & vbCrLf
    For Each objBaseBoard in colBaseBoards
            report = report & "- Nom: " & objBaseBoard.Name & vbCrLf
            report = report & "- Modèle: " & objBaseBoard.Model & vbCrLf
            report = report & "- Manufacturier: " & objBaseBoard.Manufacturer & vbCrLf
            report = report & "- Numéro de série: " & objBaseBoard.SerialNumber & vbCrLf
            report = report & "- Numéro d'inventaire (SKU): " & objBaseBoard.SKU & vbCrLf
            report = report & vbCrLf
    Next
    Set colOnBoardDevices =  objWMIService.ExecQuery _
        ("Select * from Win32_OnBoardDevice")
    report = report & "******************************************" & vbCrLf
    report = report & "Périphériques inclus sur la carte-mère (OnBoard)" & vbCrLf & "******************************************" & vbCrLf
    For Each objOnBoardDevice in colOnBoardDevices
            report = report & "- Nom du périphérique: " & objOnBoardDevice.Name & vbCrLf
            report = report & "- Nom secondaire du périphérique: " & objOnBoardDevice.Caption & vbCrLf
            report = report & "- Type de périphérique: " & objOnBoardDevice.DeviceType & vbCrLf
            report = report & "- Modèle: " & objOnBoardDevice.Model & vbCrLf
            report = report & "- Manufacturier: " & objOnBoardDevice.Manufacturer & vbCrLf
            report = report & "- Numéro de série: " & objOnBoardDevice.SerialNumber & vbCrLf
            report = report & "- Numéro d'inventaire (SKU): " & objOnBoardDevice.SKU & vbCrLf
            report = report & vbCrLf
    Next
    Set colBIOS =  objWMIService.ExecQuery _
        ("Select * from Win32_BIOS")
    report = report & "******************************************" & vbCrLf
    report = report & "BIOS - Utilitaire de détection des disques et" & vbCrLf
    report = report & " de gestion des composantes internes" & vbCrLf & "******************************************" & vbCrLf
    For Each objBIOS in colBIOS
            report = report & "- Nom: " & objBIOS.Name & vbCrLf
            report = report & "- Code d'identification: " & objBIOS.IdentificationCode & vbCrLf
            report = report & "- Manufacturier: " & objBIOS.Manufacturer & vbCrLf
            report = report & "- BIOS primaire: " & objBIOS.PrimaryBIOS & vbCrLf
            report = report & "- Date de création: " & objBIOS.ReleaseDate & vbCrLf
            report = report & "- Numéro de série: " & objBIOS.SerialNumber & vbCrLf
            report = report & "- Version: " & objBIOS.Version & vbCrLf
            report = report & "- Version (SMBIOS): " & objBIOS.SMBIOSBIOSVersion & vbCrLf
            report = report & vbCrLf
    Next
    Set colSettings = objWMIService.ExecQuery _
        ("Select * from Win32_ComputerSystem")
    report = report & "******************************************" & vbCrLf
    report = report & "Mémoire vive (RAM) et processeur" & vbCrLf & "******************************************" & vbCrLf
    For Each objComputer in colSettings
            'report = report & objComputer.Name & vbcrlf
            report = report & "- Vous avez actuellement " & objComputer.TotalPhysicalMemory /1024\1024+1 & " Mo de mémoire vive(RAM) au total." & vbcrlf
    Next
    Set colSettings = objWMIService.ExecQuery _
        ("Select * from Win32_Processor")
    For Each objProcessor in colSettings
            report = report & "- Type de processeur: "
            If objProcessor.Architecture = 0 Then
                    report = report & "x86" & vbCrLf
            ElseIf objProcessor.Architecture = 1 Then
                    report = report & "MIPS" & vbCrLf
            ElseIf objProcessor.Architecture = 2 Then
                    report = report & "Alpha" & vbCrLf
            ElseIf objProcessor.Architecture = 3 Then
                    report = report & "PowerPC" & vbCrLf
            ElseIf objProcessor.Architecture = 6 Then
                    report = report & "ia64" & vbCrLf
            Else
                    report = report & "inconnu" & vbCrLf
            End If
            report = report & "- Nom du processeur: " & objProcessor.Name & vbCrLf
            report = report & "- Description du processeur: " & objProcessor.Description & vbCrLf
            report = report & "- Vitesse actuelle du processeur: " & objProcessor.CurrentClockSpeed & " Mhz" & vbCrLf
            report = report & "- Vitesse maximale du processeur: " & objProcessor.MaxClockSpeed & " Mhz" & vbCrLf
            report = report & vbCrLf
    Next
    report = report & "******************************************" & vbCrLf
    report = report & "Disque(s) dur(s) et autres lecteurs actuellement " & vbCrLf
    report = report & "en usage" & vbCrLf & "******************************************" & vbCrLf
    Dim oFSO
    Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
    Dim oDesLecteurs
    Set oDesLecteurs = oFSO.Drives
    Dim oUnLecteur
    Dim strLectType
    For Each oUnLecteur in oDesLecteurs
            If oUnLecteur.IsReady Then
                    Select Case oUnLecteur.DriveType
                            Case 0: strLectType = "Inconnu"
                            Case 1: strLectType = "Amovible (Disquette, clé USB, etc.)"
                            Case 2: strLectType = "Fixe (Disque dur, etc.)"
                            Case 3: strLectType = "Réseau"
                            Case 4: strLectType = "CD-Rom"
                            Case 5: strLectType = "Virtuel"
                    End Select
                    report = report & "- Lettre du lecteur: " & oUnLecteur.DriveLetter & vbCrLf
                    report = report & "- Numéro de série: " & oUnLecteur.SerialNumber & vbCrLf
                    report = report & "- Type de lecteur: " & oUnLecteur.strLectType & vbCrLf
                    If (oUnLecteur.FileSystem <> "") Then
                            report = report & "- Système de fichier utilisé: " & oUnLecteur.FileSystem & vbCrLf
                    End If
                    Set objWMIService = GetObject("winmgmts:")
                    Set objLogicalDisk = objWMIService.Get("Win32_LogicalDisk.DeviceID='" & oUnLecteur.DriveLetter & ":'")
                    report = report & "- Il y a " & objLogicalDisk.FreeSpace /1024\1024+1 & " Mo d'espace restant sur ce lecteur/disque" & vbCrLf
                    report = report & "- Il y a " & objLogicalDisk.Size /1024\1024+1 & " Mo d'espace au total sur ce lecteur/disque" & vbCrLf
            End If
            report = report & vbCrLf
    Next
    Set colCartesVideo = objWMIService.ExecQuery _
        ("Select Description From Win32_VideoController")
    report = report & "******************************************" & vbCrLf
    report = report & "Carte(s) vidéo" & vbCrLf & "******************************************" & vbCrLf
    For Each objCarteVideo in colCartesVideo
            report = report & "- Nom de la carte: " & objCarteVideo.Description & vbcrlf
            report = report & vbCrLf
    Next
    Set colSoundDevices =  objWMIService.ExecQuery _
        ("Select * from Win32_SoundDevice")
    report = report & "******************************************" & vbCrLf
    report = report & "Carte(s) de son" & vbCrLf & "******************************************" & vbCrLf
    For Each objSoundDevice in colSoundDevices
     
            report = report & "- Nom de la carte: " & objSoundDevice.Description & vbCrLf
            report = report & vbCrLf
    Next
    Set colInstalledPrinters =  objWMIService.ExecQuery _
        ("Select * from Win32_Printer")
    report = report & "******************************************" & vbCrLf
    report = report & "Imprimante(s) installée(s)" & vbCrLf & "******************************************" & vbCrLf
    For Each objPrinter in colInstalledPrinters
     
            If objPrinter.Default = "True" Then
                    report = report & "- Nom de l'imprimante (par défaut): " & objPrinter.Name & vbCrLf
            Else
                    report = report & "- Nom de l'imprimante: " & objPrinter.Name & vbCrLf
            End If
            report = report & vbCrLf
    Next
    Set colAdapters = objWMIService.ExecQuery _
        ("Select * from Win32_NetworkAdapter")
    report = report & "******************************************" & vbCrLf
    report = report & "Carte(s) réseau(x)" & vbCrLf & "******************************************" & vbCrLf
    For Each objAdapter in colAdapters
            If (objAdapter.Manufacturer<>"Microsoft") Then
                    'report = report & "- Nom de la carte/adapteur (Caption): " & objAdapter.Caption & vbcrlf
                    report = report & "- Nom de la carte/adapteur: " & objAdapter.Name & vbcrlf
                    report = report & "- Type de la carte/adapteur: " & objAdapter.AdapterType & vbcrlf
                    'report = report & "- État actuel: " & objAdapter.Availability & vbcrlf
                    report = report & "- Description: " & objAdapter.Description & vbcrlf
                    report = report & "- Adresse MAC: " & objAdapter.MACAddress & vbcrlf
                    'report = report & "- Adresse réseau de la carte: " & objAdapter.NetworkAddresses & vbcrlf
                    'report = report & "- Adresse préprogrammée: " & objAdapter.PermanentAddress & vbcrlf
                    report = report & "- Nom du fabricant: " & objAdapter.Manufacturer & vbcrlf
                    report = report & "- Nom du produit: " & objAdapter.ProductName & vbcrlf
                    report = report & "- Nom de service: " & objAdapter.ServiceName & vbcrlf
                    report = report & "- Vitesse maximale: " & objAdapter.MaxSpeed & vbcrlf
                    'If (objAdapter.Speed = 0) Or (objAdapter.Speed = "") Then
                    '        report = report & "- Bande passante actuelle: Non-disponible ou si faible qu'elle indique 0" & vbcrlf
                    'Else
                    '        report = report & "- Bande passante actuelle: " & objAdapter.Speed & vbcrlf
                    'End If
                    'report = report & "- Date de la dernière réinitialisation: " & objAdapter.TimeOfLastReset & vbcrlf
     
                    Set colAdaptersConf = objWMIService.ExecQuery _
                            ("Select * from Win32_NetworkAdapterConfiguration")
                    For Each objAdapterConf in colAdaptersConf
     
                            If (objAdapter.Manufacturer<>"Microsoft") AND (objAdapter.Caption = objAdapterConf.Caption) Then
                                    report = report & "==> Configurations de la carte réseau <==" & vbcrlf
     
                                    report = report & "- Adresse IP: " & objAdapterConf.IPAddress & vbcrlf
                                    report = report & "- Masque de sous-réseau: " & objAdapterConf.IPSubnet & vbcrlf
                                    report = report & "- Le DHCP (Attribution automatique d'une adresse IP par un serveur DHCP) est-il activé:" & vbCrLf
                                    report = report & objAdapterConf.DHCPEnabled & vbcrlf
                                    report = report & "- Serveur DHCP: " & objAdapterConf.DHCPServer & vbcrlf
                                    report = report & "- Serveur(s) DNS: " & objAdapterConf.DNSServerSearchOrder & vbcrlf
                             End If
                     Next
             End If
     Next
    report = report & "- - - - - -" & vbcrlf
    report = report & "Si vous ne pouvez naviguer et que les configurations IP semblent correctes," & vbcrlf
    report = report & "vous pouvez essayer l'utilitaire WinsockFix.exe =>" & vbcrlf
    report = report & "- - - - - -" & vbcrlf
    report = report & vbcrlf
    Set colPOTSModems =  objWMIService.ExecQuery _
        ("Select * from Win32_POTSModem")
    report = report & "******************************************" & vbCrLf
    report = report & "Modem(s)" & vbCrLf & "******************************************" & vbCrLf
    For Each objPOTSModem in colPOTSModems
     
            report = report & "- Nom du modem: " & objPOTSModem.Description & vbCrLf
            report = report & vbCrLf
    Next
    Set colEcrans =  objWMIService.ExecQuery _
        ("Select * from Win32_Win32_DesktopMonitor")
    report = report & "******************************************" & vbCrLf
    report = report & "Écran(s)" & vbCrLf & "******************************************" & vbCrLf
    For Each objEcran in colEcrans
            report = report & "- Nom de l'écran: " & objEcran.Name & vbCrLf
            report = report & "- Type d'écran: " & objEcran.MonitorType & vbCrLf
            report = report & "- Nom du fabricant: " & objEcran.MonitorManufacturer & vbCrLf
            report = report & "- Hauteur: " & objEcran.ScreenHeight & vbCrLf
            report = report & "- Largeur: " & objEcran.ScreenWeight & vbCrLf
            report = report & vbCrLf
    Next
    '    report = report & "******************************************" & vbCrLf
    '    report = report & "Listes des connexions réseaux"& vbCrlf
    '    report = report & "=> Cette section peut parfois être vide même s'il" & vbCrLf
    '    report = report & " existe des connexions réseaux <=" & vbCrLf
    '    report = report & "******************************************" & vbCrLf
    'Set colConnReseaux = objWMIService.ExecQuery _
    '    ("Select * from Win32_NetworkConnection")
    'For Each objConnReseau in colConnReseaux
    '        report = report & "- Nom de la carte/adapteur: " & objConnReseau.Name & vbcrlf
    '        report = report & "- Nom local: " & objConnReseau.LocalName & vbcrlf
    '        report = report & "- Nom d'utilisateur: " & objConnReseau.UserName & vbcrlf
    '        report = report & "- Type: " & objConnReseau.DisplayType & vbcrlf
    '        report = report & "- Description: " & objConnReseau.Description & vbcrlf
    '        report = report & "- État actuel de la connexion: " & objConnReseau.ConnectionState & vbcrlf
    '        report = report & "- Nom du fournisseur: " & objConnReseau.ProviderName & vbcrlf
    '        report = report & "- Nom de la ressource distante: " & objConnReseau.RemoteName & vbcrlf
    '        report = report & "- Type de ressource: " & objConnReseau.ResourceType & vbcrlf
    '        report = report & "- Commentaire du fournisseur: " & objConnReseau.Comment & vbcrlf
    '        report = report & vbcrlf
    'Next
    REM Set colUsagers = objWMIService.ExecQuery _
        REM ("Select * from Win32_Account")
    REM report = report & "******************************************" & vbCrLf
    REM report = report & "Utilisateurs et groupes d'utilisateurs de cet ordinateur" & vbCrLf & "******************************************" & vbCrLf
     
    REM For Each objUsager in colUsagers
            REM report = report & "- Nom de l'usager ou du groupe: " & objUsager.Name & vbcrlf
            REM report = report & "- Description: " & objUsager.Description & vbcrlf
            REM report = report & "- Domaine ou ordinateur auquel il appartient: " & objUsager.Domain & vbcrlf
            REM 'report = report & "- Numéro d'identification (SID): " & objUsager.SID & vbcrlf
            REM report = report & vbcrlf
    REM Next
    oReg.EnumKey HKEY_LOCAL_MACHINE, UnInstPath, arrSubKeys
    software = "******************************************" & vbCrLf
    software = software & "Logiciels installés" & vbCrLf & "******************************************" & vbCrLf
    For Each subkey In arrSubKeys
            'MsgBox subkey
            If Left (subkey, 1) <> "{" Then
                    software = software & subkey & vbCrLf
            End If
    Next
    Set fso = CreateObject("Scripting.FileSystemObject")
    'Détermine si le fichier texte existe déjà ou s'il doit le créer
    If Not fso.FileExists("C:\inventaire.txt") Then
            set ts = fso.CreateTextFile("C:\inventaire.txt")
    End If
     
    ts.write report
    ts.write software
    'MsgBox Report
    WScript.Exit
    y'a qu'à faire un tri de ce que tu veux

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    57
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 57
    Par défaut
    Bonjour, voici mon script d'inventaire Logiciels et Update Windows.

    Celui-ci va lire la base de registre et remonte le tout dans 2 type de fichiers,
    un fichier txt et un fichier HTML.
    Il fonctionne sous Windows 2000, XP et 2003.

    Attention les fichiers d'inventaire générés sont générés dans des répertoires différents. Pour le test créer un dossier place le script dedans, puis créer un second dossier dans le premier nommé Rapports dans ce dernier tu créer respectivement un dossier TXT et un dossier Html, ou sinon modifie les lignes
    657, 658 et 660 pour la génération en txt et les lignes 678, 679 et 681 pour la génération

    Je t'envois le code en 2 postes car on est limité en nombre de caractères sur le forum

    Code Partie 1
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
     
    ' ##################################################
    ' 
    ' 		InventaireLogiciels&Update.vsb est un script d'inventaire Machine		
    ' 		Il a pour but d'effectuer l'inventaire dans un fichier Html et txt		
    ' 		des informations concernant :								
    '			- Les logiciels installés								
    '			- Les mises à jour installés							
    '														
    '		Créé le  : 27/07/2008                  			       				
    ' 		Dernière modification : 25/08/2008                           				
    ' 		Par : Gregory FERNANDEZ								
    ' 		Version : 1.0										
    ' 
    ' ##################################################
     
     
    ' Déclaration variable
    Dim ComputerName, MessageOS, datetime, CountSoft, CountUpdate
    CountSoft = 0
    CountUpdate = 0
     
    ' Déclaration de variable pour l'inventaire sur les logiciels installés
    Dim MessageSoftware, txtDisplayNameSOFT, txtDisplayVersionSOFT, txtPublisherSOFT, txtHelpLinkSOFT
    Dim DisplayNameSOFT(), DisplayVersionSOFT(), PublisherSOFT(), HelpLinkSOFT()
    Redim DisplayNameSOFT(CountSoft)
    Redim DisplayVersionSOFT(CountSoft)
    Redim PublisherSOFT(CountSoft)
    Redim HelpLinkSOFT(CountSoft)
     
    ' Déclaration de variable pour l'inventaire sur les mises à jour Windows installées
    Dim MessageUpdate, txtDisplayNameWINUPDATE, txtReleaseTypeWINUPDATE, txtInstallDateWINUPDATE, txtHelpLinkWINUPDATE
    Dim DisplayNameWINUPDATE(), ReleaseTypeWINUPDATE(), InstallDateWINUPDATE(), HelpLinkWINUPDATE()
    Redim DisplayNameWINUPDATE(CountUpdate)
    Redim ReleaseTypeWINUPDATE(CountUpdate)
    Redim InstallDateWINUPDATE(CountUpdate)
    Redim HelpLinkWINUPDATE(CountUpdate)
     
    ' Déclaration de variable pour l'inventaire Licence
    '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Dim shell, fso, net, args, Buffer, PK(25),Result(15), Key, ProductMS
    Dim ProductName, Owner, Orga, BDRKey, ProductKey, ProductID, MessageLicence
    Dim HtmlProductName(), HtmlOwner(), HtmlOrga(), HtmlBDRKey(), HtmlProductKey(), HtmlProductID(), CountLicence
    ProductMS = "AllProduct"
    CountLicence = 0
    Redim HtmlProductName(CountLicence)
    Redim HtmlOwner(CountLicence)
    Redim HtmlOrga(CountLicence)
    Redim HtmlBDRKey(CountLicence)
    Redim HtmlProductKey(CountLicence)
    Redim HtmlProductID(CountLicence)
     
    const HKEY_LOCAL_MACHINE   = &H80000002
    CharSet24 = array("B","C","D","F","G","H","J","K","M","P","Q","R","T","V","W","X","Y","2","3","4","6","7","8","9")
    '                  0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22  23
    '                  0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F  10  11  12  13  14  15  16  17
     
    Prefix="HKLM\"
    KeyDef="software\Microsoft\Windows NT\CurrentVersion"
    Entry1="DigitalProductId"
    Entry2="ProductID"
    Entry3="ProductName"
    Entry4="RegisteredOrganization"
    Entry5="RegisteredOwner"
    SW_SHOWNORMAL=1
    Set shell = WScript.CreateObject("WScript.Shell")
    Set net   = Wscript.CreateObject("WScript.Network")
    Set args  = Wscript.Arguments
    Set fso   = WScript.CreateObject("Scripting.FileSystemObject")
    'Set Named   = WScript.Arguments.Named
    'Set UnNamed = WScript.Arguments.UnNamed
    'nu=UnNamed.count
    Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & net.ComputerName & "\root\default:StdRegProv")
    '---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    '====================================================================================================
    '	 				INFORMATION SUR LE SYSTÈME D'EXPLOITATION 				
    '====================================================================================================
    Sub Info_OS ()
     
    	Set objWMIService = GetObject("winmgmts:\\" & ComputerName & "\root\cimv2")
    	Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
    	For Each objItem in colItems
     
    		MachineName = objItem.CSName
    		datetime = objItem.LocalDateTime
     
    		'---- Convertion des date et heure locale de la machine en un format lisible par l'utilisateur. ----
    		datetime = mid(datetime, 7, 2) & "/" & mid(datetime, 5, 2) & "/" & mid(datetime, 1, 4) & " - " & mid(datetime, 9, 2)& ":" & mid(datetime, 11, 2)& ":" & mid(datetime, 13, 2)
     
    		MessageOS = MessageOS & Space(14) & "******************************************" & vbCrLf
    		MessageOS = MessageOS & Space(28) & "Machine :" & vbCrLf 
    		MessageOS = MessageOS & Space(14) & "******************************************" & vbCrLf & vbCrLf & vbCrLf
     
    		MessageOS = MessageOS & FormatStrL("Nom ",30,2) & " : " & FormatStrR(MachineName,10,2) & VBCRLF	
    		MessageOS = MessageOS & FormatStrL("Date et heure locale ",30,2) & " : " & FormatStrR(datetime,10,2) & VBCRLF & VBCRLF
    		MessageOS = MessageOS & "===========================================================================" & Space(14) & VBCRLF & VBCRLF
     
    	Next
     
    End Sub		
     
     
     
    '====================================================================================================
    '	 					INFORMATIONS LOGICIELS INSTALLES	
    '====================================================================================================
    ' Infos sur les Logiciels au format Html
    Sub Info_SoftwareHtml ()
     
    	Set oShell = CreateObject("wscript.Shell")	
    	Set env = oShell.environment("Process")
    	Const HKEY_LOCAL_MACHINE = &H80000002
    	Const KeyMainPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    	Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &	ComputerName & "\root\default:StdRegProv")
     
    	oReg.EnumKey HKEY_LOCAL_MACHINE, KeyMainPath, arrSubKeys
     
    	For Each subkey In arrSubKeys
    	    If Left (subkey, 2) <> "KB" Then
     
    			KeyProd=KeyMainPath & subkey & "\" 
     
    			On Error Resume Next ' GESTION D'ERREUR SUR L'EXISTANCE OU NON DE LA CLE DE REGISTRE
    			' Test du nom de la valeur de l'application à récupérer
    				Test=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "DisplayName")				
    				If Err <> 0 Then					
    					DisplayNameSOFT(CountSoft) = "&nbsp;"					
    				Else
    					SoftwareName=oReg.GetStringValue (HKEY_LOCAL_MACHINE,KeyProd,"DisplayName",DisplayNameSOFT(CountSoft))					
    					if (DisplayNameSOFT(CountSoft) = "" OR DisplayNameSOFT(CountSoft) = " ") then
    						DisplayNameSOFT(CountSoft) = "&nbsp;"
    					end if
    				End If
     
    			if SoftwareName = 0 Then 
    				On Error Resume Next ' GESTION D'ERREUR SUR L'EXISTANCE OU NON DE LA CLE DE REGISTRE
     
    				' Test de la première valeur à récupérer
    				Test1=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "DisplayVersion")				
    				If Err <> 0 Then					
    					DisplayVersionSOFT(CountSoft) = "&nbsp;"					
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"DisplayVersion",DisplayVersionSOFT(CountSoft)
    					if (DisplayVersionSOFT(CountSoft) = "" OR DisplayVersionSOFT(CountSoft) = " ") then
    						DisplayVersionSOFT(CountSoft) = "&nbsp;"
    					end if					
    				End If
     
    				' Test de la seconde valeur à récupérer
    				Test2=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "HelpLink")
    				If Err <> 0 Then
    					HelpLinkSOFT(CountSoft) = "&nbsp;"
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"HelpLink",HelpLinkSOFT(CountSoft)
    					if (HelpLinkSOFT(CountSoft) = "" OR HelpLinkSOFT(CountSoft) = " ") then
    						HelpLinkSOFT(CountSoft) = "&nbsp;"
    					end if
    				End If
     
    				' Test de la troisième valeur à récupérer
    				Test3=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "Publisher")
    				If Err <> 0 Then
    					PublisherSOFT(CountSoft) = "&nbsp;"
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"Publisher",PublisherSOFT(CountSoft)
    					if (PublisherSOFT(CountSoft) = "" OR PublisherSOFT(CountSoft) = " ") then
    						PublisherSOFT(CountSoft) = "&nbsp;"
    					end if
    				End If
     
    			end if		
     
    		End If	
     
    		' Si tous les valeurs que l'on récupères sont vide alors on n'incrémenta pas le compteur
    		' De même si les clés testées commences pas "KB" ce sont des mises à jour on n'icrémente pas le compteur
    		' Pour tous les autres cas on incrémente le compteurs.
    		if DisplayNameSOFT(CountSoft) = "&nbsp;" AND DisplayVersionSOFT(CountSoft) = "&nbsp;" AND HelpLinkSOFT(CountSoft) = "&nbsp;" AND PublisherSOFT(CountSoft) = "&nbsp;" then
    			CountSoft = CountSoft
    		elseif Left (subkey, 2) = "KB" Then
    			CountSoft = CountSoft
    		else 
    			CountSoft = CountSoft+1			
    			Redim Preserve DisplayNameSOFT(CountSoft) 
    			Redim Preserve DisplayVersionSOFT(CountSoft) 			
    			Redim Preserve HelpLinkSOFT(CountSoft) 
    			Redim Preserve PublisherSOFT(CountSoft)
    		end if
    	Next
     
    End Sub
     
     
    ' Infos sur les Logiciels au format txt
    Sub Info_SoftwareTxt ()
     
    	Set oShell = CreateObject("wscript.Shell")
    	Set env = oShell.environment("Process")
    	Const HKEY_LOCAL_MACHINE = &H80000002
    	Const KeyMainPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    	Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &	ComputerName & "\root\default:StdRegProv")
     
    	oReg.EnumKey HKEY_LOCAL_MACHINE, KeyMainPath, arrSubKeys
     
    	MessageSoftware = MessageSoftware & Space(14) & "******************************************" & vbCrLf
    	MessageSoftware = MessageSoftware & Space(24) & "Logiciels installés :" & vbCrLf 
    	MessageSoftware = MessageSoftware & Space(14) & "******************************************" & vbCrLf & vbCrLf & vbCrLf
     
    	For Each subkey In arrSubKeys
    	    If Left (subkey, 2) <> "KB" Then
     
    			KeyProd=KeyMainPath & subkey & "\" 
     
    			SoftwareName=oReg.GetStringValue (HKEY_LOCAL_MACHINE,KeyProd,"DisplayName",txtDisplayNameSOFT)
     
    			if SoftwareName = 0 Then 
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"DisplayVersion",txtDisplayVersionSOFT
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"HelpLink",txtHelpLinkSOFT
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"Publisher",txtPublisherSOFT
     
    				MessageSoftware = MessageSoftware & txtDisplayNameSOFT & VBCRLF
    				MessageSoftware = MessageSoftware & FormatStrL("Version",5,2) &  " : " & FormatStrR(txtDisplayVersionSOFT,5,2) & VBCRLF
    				MessageSoftware = MessageSoftware & FormatStrL("Éditeur",5,2) &  " : " & FormatStrR(txtPublisherSOFT,5,2) & VBCRLF
    				MessageSoftware = MessageSoftware & FormatStrL("Support",5,2) &  " : " & FormatStrR(txtHelpLinkSOFT,5,2) & VBCRLF & VBCRLF
    				MessageSoftware = MessageSoftware & "---------------------------------------------------------------------------" & Space(14) & VBCRLF & VBCRLF
     
    			end if		
     
    		End If
     
    	Next
     
    	MessageSoftware = MessageSoftware & "===========================================================================" & Space(14) & VBCRLF & VBCRLF
     
    End Sub
     
    '==================================================================================================================
    '	 					INFORMATIONS SUR LES LICENCES
    '
    '					ADAPTÉ DU CODE DE JC. BELLAMY (http://jc.bellamy.free.fr/)
    '==================================================================================================================
    Function Find_MS_KeyProduct(ProductMS)
     
    On Error Resume Next
     
    Select Case ProductMS
    'Analyse clef BDR
    	Case "Windows" 		
    		If nu=0 Then Key=KeyDef else Key=UnNamed(0)		
    		coderet=oReg.GetBinaryValue(HKEY_LOCAL_MACHINE, Key, Entry1, Buffer)
    		If CodeRet<>0 Then
    			Wscript.echo "Erreur BDR"
    			Exit Function 	
    		End If
    		For index = 0 to 14
    			PK(index)=Buffer(index+&H34)
    		Next
    		PrintResult 
    'Enumération de toutes les clefs
    	Case "AllProduct"
    		On error goto 0		
    		'rep=shell.Popup("Veuillez patienter SVP." & VBCRLF & "La recherche des clefs peut prendre un certain temps", _
    		'3, "Clefs de produits Microsoft sur " & Computer,65) 
    		If rep=2 Then Wscript.quit
    		ExploreKey("Software\Microsoft")
    'ProductKey
    			j=0
    			For index = 1 To len(Key)
    '	conversion des caractères en base24
    				v=valueB24(Mid(Key,index,1)) 
    				If v>=0 Then
    					PK(j)=v
    					j=j+1
    				End If	
    			Next
    			If j<>25 Then				
    				Exit Function 
    			End If
    '	conversion en binaire
    			For i = 0 To 14 
    				Result(i)=0
    			Next
    			NumDigits=24
    			ResLen=15
    			For i= 0 To 24
    				Aux=PK(i)
    				m=0
    				Do
    					Aux=Result(m)*NumDigits + Aux
    					Result(m)= Aux AND 255
    					m=m+1
    					Aux=int(Aux/256)
    				Loop Until m >= ResLen
    			Next
    			For i = 0 To 14
    				PK(i)=Result(i)
    			Next
    			PrintResult 
    	End Select
     
    End Function
     
     
    '--------------------------------------------------------------------
    'Exploration récursive de la BDR 
    'recherche des entrées "DigitalProductId"
    Sub ExploreKey(CurKey)
    	coderet=oReg.GetBinaryValue(HKEY_LOCAL_MACHINE,CurKey,Entry1,Buffer)
    	If CodeRet=0 Then
    	'Entrée trouvée. Extraction RAWKey
    		For index = 0 to 14
    			PK(index)=Buffer(index+&H34)
    		Next
    		Key=CurKey					
    		PrintResult 
    		Exit Sub
    	end if
    	Dim arrSubKeys
    	'Enumération des sous-clefs
    	coderet=oReg.EnumKey(HKEY_LOCAL_MACHINE,CurKey,arrSubKeys)
    	If codeRet=0 Then
    		If IsArray(arrSubKeys) Then
    			For Each subkey In arrSubKeys
    				ExploreKey(CurKey & "\" & subkey)
    			Next
    		End If
    	end if
    End Sub
    '--------------------------------------------------------------------
    Sub PrintResult 		
    	RAWKeyBE=""
    	RAWKeyLE=""
    	'Calcul du ProductID (algorithme valable seulement pour Windows) 
    	For index =  0 To 3 
    		CurByte=PK(Index)
    		If index =  3 Then CurByte=CurByte and &H7F
    		S=Hexa(CurByte) & S  
    	next
    	PID=int(("&H" &S) /2)
    	SPID=CStr(PID)
    	While len(SPID)<9
    		SPID="0" & SPID
    	Wend
    	SPID1=left(SPID,3)
    	SPID2=mid(SPID,4)
    	sigma=0
    	For i = 1 To len(SPID2)
    		sigma=sigma+Asc(mid(SPID2,i,1))-48
    	Next
    	m=7-sigma mod 7
    	SPID=SPID1 & "-" & SPID2 & m
    	'Conversion RAWKey en ProductKey
    	S=""
    	For i = 24 To 0 Step -1
    		r = 0
    		For j = 14 To 0 Step -1
    			r = r * 256 Xor PK(j)
    			PK(j) = Int(r/24)
    			r = r Mod 24
    		Next
    		S=CharSet24(r) & S 
    		If i Mod 5 = 0 And i <> 0 Then S="-" & S
    	Next
     
    	ProductKey = S
     
    	coderet=oReg.GetStringValue(HKEY_LOCAL_MACHINE, Key, Entry3, SPID)
    	If Coderet=0 Then 
    		ProductName = SPID		
    	Else
    		'---- Si la clé de regisyte n'existe pas on prend le nom du repertoire  ----
    		ProductName = mid(Key, 20, 200)		
    		NomProduit = Split(ProductName, "\")
    		ProductName = NomProduit(0)
    	End If
     
    	BDRKey = "HKLM\" & Key & "\" & Entry1	
    	coderet=oReg.GetStringValue(HKEY_LOCAL_MACHINE, Key, Entry4, SPID)
    	If Coderet=0 Then Owner = SPID
    	coderet=oReg.GetStringValue(HKEY_LOCAL_MACHINE, Key, Entry5, SPID)
    	If Coderet=0 Then Orga = SPID
     
    	coderet=oReg.GetStringValue(HKEY_LOCAL_MACHINE, Key, Entry2, SPID)
    	If Coderet=0 Then ProductID = SPID
     
     
     
    	MessageLicence = MessageLicence & Space(14) & "******************************************" & vbCrLf
    	MessageLicence = MessageLicence & Space(28) & "Licence :" & vbCrLf 
    	MessageLicence = MessageLicence & Space(14) & "******************************************" & vbCrLf & vbCrLf & vbCrLf
     
    	MessageLicence = MessageLicence & FormatStrL("Nom du Produit ",30,2) & " : " & FormatStrR(ProductName,10,2) & VBCRLF		
    	MessageLicence = MessageLicence & FormatStrL("Propriétaire déclaré ",30,2) & " : " & FormatStrR(Owner,10,2) & VBCRLF
    	MessageLicence = MessageLicence & FormatStrL("Organisation déclarée ",30,2) & " : " & FormatStrR(Orga,10,2) & VBCRLF
    	MessageLicence = MessageLicence & FormatStrL("Clé de registre ",30,2) & " : " & FormatStrR(BDRKey,10,2) & VBCRLF
    	MessageLicence = MessageLicence & FormatStrL("Identification du produit  ",30,2) & " : " & FormatStrR(ProductID,10,2) & VBCRLF	
    	MessageLicence = MessageLicence & FormatStrL("Clé du produit ",30,2) & " : " & FormatStrR(ProductKey,10,2) & VBCRLF		
     
    	MessageLicence = MessageLicence & "===========================================================================" & Space(14) & VBCRLF & VBCRLF
     
    	HtmlProductName(CountLicence) = ProductName
    	HtmlOwner(CountLicence) = Owner
    	HtmlOrga(CountLicence) = Orga
    	HtmlBDRKey(CountLicence) = BDRKey
    	HtmlProductKey(CountLicence) = ProductKey
    	HtmlProductID(CountLicence) = ProductID
     
    	CountLicence = CountLicence+1
    	Redim Preserve HtmlProductName(CountLicence)
    	Redim Preserve HtmlOwner(CountLicence)
    	Redim Preserve HtmlOrga(CountLicence)
    	Redim Preserve HtmlBDRKey(CountLicence)
    	Redim Preserve HtmlProductKey(CountLicence)
    	Redim Preserve HtmlProductID(CountLicence)	
     
    End Sub
    '--------------------------------------------------------------------
    'Affichage hexadécimal d'un octet avec 0 non significatif éventuel
    Function hexa(n)
    	ch=hex(n)
    	If len(ch)<2 then ch="0" & ch
    	hexa=ch
    End Function
    '--------------------------------------------------------------------
    Function valueB24(c)
    	valueB24=-1
    	c=ucase(c)
    	For i = 0 To 23
    		If c=CharSet24(i) Then
    			valueB24=i		
    			exit for
    		End If
    	Next
    End Function
    '--------------------------------------------------------------------
     
    '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
    '====================================================================================================
    '	 					INFORMATIONS MISE A JOUR DE WINDOWS		
    '====================================================================================================
    ' Infos sur les Mises à jour au format Html
    Sub Info_WindowsUpdateHtml ()
     
    	Set oShell = CreateObject("wscript.Shell")	
    	Set env = oShell.environment("Process")
    	Const HKEY_LOCAL_MACHINE = &H80000002
    	Const KeyMainPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    	Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &	ComputerName & "\root\default:StdRegProv")
     
    	oReg.EnumKey HKEY_LOCAL_MACHINE, KeyMainPath, arrSubKeys
     
    	For Each subkey In arrSubKeys
    	    If Left (subkey, 2) = "KB" Then
     
    			KeyProd=KeyMainPath & subkey & "\" 
     
    			On Error Resume Next ' GESTION D'ERREUR SUR L'EXISTANCE OU NON DE LA CLE DE REGISTRE
    			' Test du nom de la valeur de l'application à récupérer
    				Test=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "DisplayName")				
    				If Err <> 0 Then					
    					DisplayNameWINUPDATE(CountUpdate) = "&nbsp;"					
    				Else
    					HotFixeName=oReg.GetStringValue (HKEY_LOCAL_MACHINE,KeyProd,"DisplayName",DisplayNameWINUPDATE(CountUpdate))					
    					if (DisplayNameWINUPDATE(CountUpdate) = "" OR DisplayNameWINUPDATE(CountUpdate) = " ") then
    						DisplayNameWINUPDATE(CountUpdate) = "&nbsp;"
    					end if
    				End If
     
    			if HotFixeName = 0 Then 
    				On Error Resume Next ' GESTION D'ERREUR SUR L'EXISTANCE OU NON DE LA CLE DE REGISTRE
     
    				' Test de la première valeur à récupérer
    				Test1=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "ReleaseType")				
    				If Err <> 0 Then					
    					ReleaseTypeWINUPDATE(CountUpdate) = "&nbsp;"					
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"ReleaseType",ReleaseTypeWINUPDATE(CountUpdate)
    					if (ReleaseTypeWINUPDATE(CountUpdate) = "" OR ReleaseTypeWINUPDATE(CountUpdate) = " ") then
    						ReleaseTypeWINUPDATE(CountUpdate) = "&nbsp;"
    					end if					
    				End If
     
    				' Test de la seconde valeur à récupérer
    				Test2=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "InstallDate")
    				If Err <> 0 Then
    					InstallDateWINUPDATE(CountUpdate) = "&nbsp;"
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"InstallDate",InstallDateWINUPDATE(CountUpdate)
    					if (InstallDateWINUPDATE(CountUpdate) = "" OR InstallDateWINUPDATE(CountUpdate) = " ") then
    						InstallDateWINUPDATE(CountUpdate) = "&nbsp;"						
    					else				
    						'---- Convertion des date d'installation en un format lisible par l'utilisateur. ----
    						InstallDateWINUPDATE(CountUpdate) = mid(InstallDateWINUPDATE(CountUpdate), 7, 2) & "/" & mid(InstallDateWINUPDATE(CountUpdate), 5, 2) & "/" & mid(InstallDateWINUPDATE(CountUpdate), 1, 4)
    					end if 
    				End If
     
    				' Test de la troisième valeur à récupérer
    				Test3=oShell.RegRead("HKEY_LOCAL_MACHINE\" & KeyProd & "HelpLink")
    				If Err <> 0 Then
    					HelpLinkWINUPDATE(CountUpdate) = "&nbsp;"
    				Else
    					oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"HelpLink",HelpLinkWINUPDATE(CountUpdate)
    					if (HelpLinkWINUPDATE(CountUpdate) = "" OR HelpLinkWINUPDATE(CountUpdate) = " ") then
    						HelpLinkWINUPDATE(CountUpdate) = "&nbsp;"
    					end if
    				End If
     
    			end if		
     
    		End If	
     
    		' Si tous les valeurs que l'on récupères sont vide alors on n'incrémenta pas le compteur
    		' De même si les clés testées ne commences pas par "KB" ce ne sont pas des mises à jour on n'icrémente pas le compteur
    		' Pour tous les autres cas on incrémente le compteurs.
    		if DisplayNameWINUPDATE(CountUpdate) = "&nbsp;" AND ReleaseTypeWINUPDATE(CountUpdate) = "&nbsp;" AND InstallDateWINUPDATE(CountUpdate) = "&nbsp;" AND HelpLinkWINUPDATE(CountUpdate) = "&nbsp;" then
    			CountUpdate = CountUpdate
    		elseif Left (subkey, 2) <> "KB" Then
    			CountUpdate = CountUpdate
    		else 
    			CountUpdate = CountUpdate+1			
    			Redim Preserve DisplayNameWINUPDATE(CountUpdate)
    			Redim Preserve ReleaseTypeWINUPDATE(CountUpdate)
    			Redim Preserve InstallDateWINUPDATE(CountUpdate)
    			Redim Preserve HelpLinkWINUPDATE(CountUpdate)
    		end if
    	Next
     
    End Sub
     
    ' Infos sur les Mises à jour au format txt
    Sub Info_WindowsUpdateTxt ()
     
    	Set oShell = CreateObject("wscript.Shell")
    	Set env = oShell.environment("Process")
    	Const HKEY_LOCAL_MACHINE = &H80000002
    	Const KeyMainPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    	Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &	ComputerName & "\root\default:StdRegProv")
     
    	oReg.EnumKey HKEY_LOCAL_MACHINE, KeyMainPath, arrSubKeys
     
    	MessageUpdate = MessageUpdate & Space(14) & "******************************************" & vbCrLf
    	MessageUpdate = MessageUpdate & Space(24) & "Mises à jour Windows :" & vbCrLf 
    	MessageUpdate = MessageUpdate & Space(14) & "******************************************" & vbCrLf & vbCrLf & vbCrLf
     
    	For Each subkey In arrSubKeys
    	    If Left (subkey, 2) = "KB" Then
     
    			KeyProd=KeyMainPath & subkey & "\" 
     
    			HotFixeName=oReg.GetStringValue (HKEY_LOCAL_MACHINE,KeyProd,"DisplayName",txtDisplayNameWINUPDATE)
     
    			if HotFixeName = 0 Then 				
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"ReleaseType",txtReleaseTypeWINUPDATE
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"InstallDate",txtInstallDateWINUPDATE
    				oReg.GetStringValue HKEY_LOCAL_MACHINE,KeyProd,"HelpLink",txtHelpLinkWINUPDATE
     
    				if txtInstallDateWINUPDATE <> "" Then 				
    					'---- Convertion des date d'installation en un format lisible par l'utilisateur. ----
    					txtInstallDateWINUPDATE = mid(txtInstallDateWINUPDATE, 7, 2) & "/" & mid(txtInstallDateWINUPDATE, 5, 2) & "/" & mid(txtInstallDateWINUPDATE, 1, 4)
    				end if 
     
    				MessageUpdate = MessageUpdate & txtDisplayNameWINUPDATE & VBCRLF
    				MessageUpdate = MessageUpdate & FormatStrL("Type",20,2) &  " : " & FormatStrR(txtReleaseTypeWINUPDATE,5,2) & VBCRLF
    				MessageUpdate = MessageUpdate & FormatStrL("Date d'Installation",20,2) &  " : " & FormatStrR(txtInstallDateWINUPDATE,5,2) & VBCRLF
    				MessageUpdate = MessageUpdate & FormatStrL("Support",20,2) &  " : " & FormatStrR(txtHelpLinkWINUPDATE,5,2) & VBCRLF & VBCRLF
    				MessageUpdate = MessageUpdate & "---------------------------------------------------------------------------" & Space(14) & VBCRLF & VBCRLF
     
    			end if		
     
    		End If
    	Next
     
    	MessageUpdate = MessageUpdate & "===========================================================================" & Space(14) & VBCRLF & VBCRLF
     
    End Sub
     
    '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  4. #4
    Membre averti
    Profil pro
    Inscrit en
    Juin 2007
    Messages
    57
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2007
    Messages : 57
    Par défaut
    Voilà la suite

    Code Partie 2
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
     
    '===============================================================================================
    '		FONCTION DE MISE EN FORME POUR L'AFFICHAGE DU FICHIER DE SORTIE
    '===============================================================================================	
     
    '**********************************************************************
    ' Fonction de mise en forme du tableau : alignement des infos vers la gauche
    ' (ajout des espaces à la droite de la chaine de carractère)
    '***********************************************************************
    Function FormatStrL(ch,lmax,ExitFile)
    l=len(ch)							' On calcule le nombre de carractère qui compose la chaine.
    If l<lmax Then 						' Si ce nombre est inférieur à lmax (lmax correspond à la largeur max que l'on souhaite pour la colonne du tableau) alors 
    	For k = l+1 To lmax				' On ajoute le nombre d'espace requis à la chaine de carractère pour avoir la bonne largeur à la cellule du tableau. 
    		Select Case (ExitFile)
    			case 1
    				ch=ch & "&nbsp"
    			case 2
    				ch=ch & " "
    		End Select
    	Next
    End If
    FormatStrL=ch						' On renvoie le résultat du traitement.
    End Function
     
    '**********************************************************************
    ' Fonction de mise en forme du tableau : alignement des infos vers la droite
    ' (ajout des espaces à la gauche de la chaine de carractère)
    '**********************************************************************
     
    Function FormatStrR(ch,lmax,ExitFile)
    l=len(ch)							' On calcule le nombre de carractère qui compose la chaine.
    If l<lmax Then 						' Si ce nombre est inférieur à lmax (lmax correspond à la largeur max que l'on souhaite pour la colonne du tableau) alors 
    	For k = l+1 To lmax				' On ajoute le nombre d'espace requis à la chaine de carractère pour avoir la bonne largeur à la cellule du tableau.
    		Select Case (ExitFile)
    			case 1
    				ch="&nbsp" & ch
    			case 2
    				ch=" " & ch
    		End Select
    	Next
    End If
    FormatStrR=ch						' On renvoie le résultat du traitement.
    End Function
     
    '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     
     
    '============================================================
    '		ENCHAINEMENT DES INSTRUCTIONS
    '============================================================
    On Error Resume Next
     
    ' ******************************
    ' Récupération du ComputerName 
    ' ******************************
    Set WSHShell = WScript.CreateObject("WScript.Network")
    ComputerName = WSHShell.ComputerName 
     
    ' ******************************************************
    ' Récupération des Informations par appel de procédures  
    ' ******************************************************
    Info_OS								' Récupération des informations sur le Système d'Exploitation
     
    Info_SoftwareHtml					' Récupération des informations sur les Logiciels Installés au format Html
    Info_SoftwareTxt					' Récupération des informations sur les Logiciels Installés au format txt
     
    Find_MS_KeyProduct ProductMS		' Récupération des informations sur la Licence
     
    Info_WindowsUpdateHtml				' Récupération des informations sur les Mise à jour Windows au format Html
    Info_WindowsUpdateTxt				' Récupération des informations sur les Mise à jour Windowsau format txt
     
    '*****************************************
    '	Génération du fichier de sortie TXT		
    '*****************************************
    Set fso = CreateObject("Scripting.FileSystemObject")
     
    '---- Détermine si le fichier texte existe déjà ou s'il doit le créer ----
    If Not fso.FileExists(".\Rapports\txt\Invt_" & ComputerName & "_Logiciels&Update" & ".txt") Then
            set ts = fso.CreateTextFile(".\Rapports\txt\Invt_" & ComputerName & "_Logiciels&Update" & ".txt", True)
    Else
    		set ts = fso.OpenTextFile(".\Rapports\txt\Invt_" & ComputerName & "_Logiciels&Update" & ".txt", 2, True)
    End If
     
     
    ' On ecrit dans le fichier txt
    ts.write MessageOS
    ts.write MessageSoftware
    ts.write MessageLicence
    ts.write MessageUpdate
     
     
    '======================================================================================================================
    '******************************************
    '	Génération du fichier de sortie HTML		
    '******************************************
    Set fso = CreateObject("Scripting.FileSystemObject")
     
    '---- Détermine si le fichier texte existe déjà ou s'il doit le créer ----
    If Not fso.FileExists(".\Rapports\html\Invt_" & ComputerName & "_Logiciels&Update" & ".html") Then
            set ts = fso.CreateTextFile(".\Rapports\html\Invt_" & ComputerName & "_Logiciels&Update" & ".html", True)
    Else
            set ts = fso.OpenTextFile(".\Rapports\html\Invt_" & ComputerName & "_Logiciels&Update" & ".html", 2, True)
    End If
     
     
    ' On ecrit dans le fichier html
    ts.writeline "<HTML>"
    ts.writeline "<HEAD>"
    ts.writeline "<!--<META NAME='GENERATOR' CONTENT='Inventaire Machine par G.FERNANDEZ'>-->"
    ts.writeline "</HEAD>"
    ts.writeline "<STYLE>"
    ts.writeline "A { text-decoration: none }"
    ts.writeline "A:hover { text-decoration: underline }"
    ts.writeline "TD { font: 80% verdana, arial; color: #000000; vertical-align: text-center; text-align: left }"
    ts.writeline "TD.cr { font: 80% verdana, arial; color: #000000; vertical-align: text-center; text-align: right }"
    ts.writeline "TD.cc { font: 80% verdana, arial; color: #000000; vertical-align: text-center; text-align: center }"
    ts.writeline "TD.pt { font: bold 140% verdana, arial; color: #000080; vertical-align: text-center }"
    ts.writeline "TD.dt { font: bold 110% verdana, arial; color: #000080; vertical-align: text-center }"
    ts.writeline "td.GBTxt { font: bold verdana; color: Blue}"
    ts.writeline "td.BTxt { font: verdana; color: Blue}"
    ts.writeline "td.GRTxt { font: bold verdana; color: Red}"
    ts.writeline "td.RTxt { font: verdana; color: Red}"
    ts.writeline "td.tpTxt { font-size: 9px; font-weight:bold}"
    ts.writeline "a:link {color:red; text-decoration: underline;}"
    ts.writeline "a:visited {color:red; text-decoration: underline;}"
    ts.writeline "a:hover {color:red; text-decoration: none;}"
    ts.writeline "</STYLE>"
    ts.writeline "<SCRIPT language='JavaScript'>"
    ts.writeline "//====================================================================="
    ts.writeline "// Ces fonctions permettent la séléction d'une ligne sur un tableau ."
    ts.writeline "//====================================================================="
    ts.writeline "var select = 0; var temp;"
    ts.writeline "// colore la ligne en transparent"
    ts.writeline "function transparent(ligne)"
    ts.writeline "{       if (ligne!=temp && ligne.style.background!='#FDFFB9') ligne.style.background='#FDFFB9'; }"
    ts.writeline "// colore la ligne en vert"
    ts.writeline "function green(ligne)"
    ts.writeline "{       if (ligne!=temp && ligne.style.background!='#00FF99') ligne.style.background='#00FF99'; }"
    ts.writeline "// colore la ligne en transparent si elle est verte"
    ts.writeline "// remet en transparent la ligne selectionnée precedement et colore celle si en vert si differente"
    ts.writeline "// indique qu'une ligne est selectionnée en mettant le parametre select a 1"
    ts.writeline "function selec(ligne)"
    ts.writeline "{       if (!select)    {       select = 1; ligne.style.background='lavender'; temp = ligne;    }"
    ts.writeline "	else	{       if (ligne.style.background=='lavender'){ select = 0; ligne.style.background='#FDFFB9'; temp = ligne;}"
    ts.writeline "				else{       temp.style.background='#FDFFB9'; ligne.style.background='lavender'; temp=ligne;} } }"
    ts.writeline "</SCRIPT>"
    ts.writeline "<TITLE>Inventaire Logiciel & Update<" & ComputerName &  " - par GFE></TITLE>"
    ts.writeline "<BODY BGCOLOR=""#FDFFB9"">"
    ts.writeline "<TABLE WIDTH=100% border=0>"
    ts.writeline "<tr><table  border=0><tr><td CLASS=dt><A NAME=""haut"">Inventaire Machine :</td>"
    ts.writeline "<td CLASS=dt>" & ComputerName & " du " & datetime & "</td></tr>"
    ts.writeline "<tr><td CLASS=pt><br></td></tr>"
    ts.writeline "<tr><table  border=0>"
    ts.writeline "<tr><td CLASS=RTxt><A HREF=""#1"">Logiciels </A></td><td>&nbsp;&nbsp;&nbsp;</td>"
    ts.writeline "<td CLASS=RTxt><A HREF=""#2"">Licence(s) </A></td><td>&nbsp;&nbsp;&nbsp;</td>"
    ts.writeline "<td CLASS=RTxt><A HREF=""#3"">Mises à jour </A></td></tr>"
    ts.writeline "<tr><td CLASS=pt><br></td></tr>"
    ts.writeline "</table>"
    ts.writeline "<tr><table WIDTH=100% border=0><tr><td CLASS=pt COLSPAN=2>Logiciels & Mises à jour Installés</td></tr></table>"
    ts.writeline "</tr><tr><hr></tr>"
    ts.writeline "</TABLE>"
    '===============================================================================================================================================================
    ' 										TABLEAU D'INFORMATION SUR LES APPLICATIONS INSTALLEES (DYNAMIQUE)
    '===============================================================================================================================================================
    ts.writeline "<br><br><br>"
    ts.writeline "<TABLE WIDTH=100% border=0>"
    ts.writeline "<tr><table  border=0><td CLASS=dt><A NAME=""1"">Logiciels :</td></table>"
    ts.writeline "</tr><tr><hr></tr>"
    ts.writeline "</TABLE>"
    ts.writeline "<Table  border=0 width=100%>"
    ts.writeline "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan=3>"
    ts.writeline "<TABLE border=1 cellspacing=1 width=100%>" 
    ts.writeline "<tr>" 
    ts.writeline "<td width=40%>" 
    ts.writeline "<p align=center><b>Programme</b></td>"
    ts.writeline "<td width=15%>" 
    ts.writeline "<p align=center><b>Version</b></td>"  
    ts.writeline "<td width=15%>" 
    ts.writeline "<p align=center><b>Editeur</b></td>"  
    ts.writeline "<td width=30%>" 
    ts.writeline "<p align=center><b>Support</b></td>"  
    ts.writeline "</tr>" 
    ts.writeline "<tr>" 
    for i = 0 to CountSoft-1	' On fait -1 à CountDisk car le dernier la fonction des infos disques incémente le compteur à chaque fin d'inventaire disque
    ts.writeline "<tr onclick='selec(this)' onmousemove='green(this)' onmouseout ='transparent(this)' style='cursor:pointer'>"
    ts.writeline "<td width=3%><p align=center><b><font color==FF0000>" & DisplayNameSOFT(i) & "</font></b></td>" 
    ts.writeline "<td width=10%><p align=center><b><font color==FF0000>" & DisplayVersionSOFT(i) & "</font></b></td>"
    ts.writeline "<td width=5%><p align=center><b><font color==FF0000>" & PublisherSOFT(i) & "</font></b></td>"
    ts.writeline "<td width=5%><p align=center><b><font color==FF0000><a href='" & HelpLinkSOFT(i) & "' target=_blank>" & HelpLinkSOFT(i) & "</a></font></b></td>"
    ts.writeline "</tr>" 
    next
    ts.writeline "</TABLE></td></tr></TABLE>"
    ts.writeline "<table border=0><tr><td width=16>&nbsp;</td><td width=25% class=tpTxt><A HREF=""#haut"">(haut)</A></td><td></td></tr><table>"	
    '===============================================================================================================================================================
    ' 										TABLEAU D'INFORMATION SUR LES LICENCES
    '===============================================================================================================================================================
    ts.writeline "<br><br><br>"
    ts.writeline "<TABLE WIDTH=100% border=0>"
    ts.writeline "<tr><table  border=0><td CLASS=dt><A NAME=""2"">Licence(s) :</td></table>"
    ts.writeline "</tr><tr><hr></tr>"
    ts.writeline "</TABLE>"
    ts.writeline "<TABLE border=0>"
    for i=0 to CountLicence-1 ' On fait -1 à CountLicence car le dernier la fonction des infos Licence incémente le compteur à chaque fin d'inventaire de licence
    	ts.writeline "<tr><td></td><td></td><td></td><td>Nom du Produit&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td class=GBTxt>" & HtmlProductName(i) & "</td></tr>"
    	ts.writeline "<tr><td></td><td></td><td></td><td>Propriétaire déclaré&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td class=BTxt>" & HtmlOwner(i) & "</td></tr>"
    	ts.writeline "<tr><td></td><td></td><td></td><td>Organisation déclarée&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td>" & HtmlOrga(i) & "</td></tr>"
    	ts.writeline "<tr><td></td><td></td><td></td><td>Clé de registre&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td>" & HtmlBDRKey(i) & "</td></tr>"
    	ts.writeline "<tr><td></td><td></td><td></td><td>Identification du produit&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td class=GRTxt>" & HtmlProductKey(i) & "</td></tr>"
    	ts.writeline "<tr><td></td><td></td><td></td><td>Clé du produit&nbsp;&nbsp;</td><td>&nbsp; : &nbsp;</td><td>" & HtmlProductID(i) & "</td></tr>"	
    	ts.writeline "<tr><td></td><td></td><td></td><td class=tpTxt><A HREF=""#haut"">(haut)</A></td><td class=GBTxt><br><br><br></td></tr>"
    	ts.writeline "<tr><td>&nbsp;</td></tr>"
    next
    ts.writeline "</TABLE>"
    '===============================================================================================================================================================
    ' 										TABLEAU D'INFORMATION SUR LES MISES A JOUR INSTALLEES (DYNAMIQUE)
    '===============================================================================================================================================================
    ts.writeline "<br><br><br>"
    ts.writeline "<TABLE WIDTH=100% border=0>"
    ts.writeline "<tr><table  border=0><td CLASS=dt><A NAME=""3"">Mises à jour :</td></table>"
    ts.writeline "</tr><tr><hr></tr>"
    ts.writeline "</TABLE>"
    ts.writeline "<Table  border=0 width=100%>"
    ts.writeline "<tr><td></td><td></td><td></td><td></td><td></td><td></td><td colspan=3>"
    ts.writeline "<TABLE border=1 cellspacing=1 width=100%>" 
    ts.writeline "<tr>" 
    ts.writeline "<td width=40%>" 
    ts.writeline "<p align=center><b>Mise à Jour</b></td>"
    ts.writeline "<td width=15%>" 
    ts.writeline "<p align=center><b>Type</b></td>"  
    ts.writeline "<td width=15%>" 
    ts.writeline "<p align=center><b>Date d'installation</b></td>"  
    ts.writeline "<td width=30%>" 
    ts.writeline "<p align=center><b>Support</b></td>"  
    ts.writeline "</tr>" 
    ts.writeline "<tr>" 
    for i = 0 to CountSoft-1	' On fait -1 à CountDisk car le dernier la fonction des infos disques incémente le compteur à chaque fin d'inventaire disque
    ts.writeline "<tr onclick='selec(this)' onmousemove='green(this)' onmouseout ='transparent(this)' style='cursor:pointer'>"
    ts.writeline "<td width=3%><p align=center><b><font color==FF0000>" & DisplayNameWINUPDATE(i) & "</font></b></td>" 
    ts.writeline "<td width=10%><p align=center><b><font color==FF0000>" & ReleaseTypeWINUPDATE(i) & "</font></b></td>"
    ts.writeline "<td width=5%><p align=center><b><font color==FF0000>" & InstallDateWINUPDATE(i) & "</font></b></td>"
    ts.writeline "<td width=5%><p align=center><b><font color==FF0000><a href='" & HelpLinkWINUPDATE(i) & "' target=_blank>" & HelpLinkWINUPDATE(i) & "</a></font></b></td>"
    ts.writeline "</tr>" 
    next
    ts.writeline "</TABLE></td></tr></TABLE>"
    ts.writeline "<table border=0><tr><td width=16>&nbsp;</td><td width=25% class=tpTxt><A HREF=""#haut"">(haut)</A></td><td></td></tr><table>"	
    '===============================================================================================================================================================
    ' Affichage du message de fin d'inventaire.
    'Msgbox "Inventaire Terminé" & Space(10), vbInformation, "Inventaire"
     
    ' Affichage du message du fichier de sortie, résultat de l'inventaire.
    'Set WSHShell = CreateObject("WScript.Shell")
    'WSHShell.run (ComputerName & "_Inventaire" & ".txt")
    Wscript.quit 'On quite le script
    en espérant que celà réponde à tes attentes.

Discussions similaires

  1. Recherche un outil d'inventaire de parc informatique
    Par hélios44 dans le forum Autres Logiciels
    Réponses: 3
    Dernier message: 19/08/2009, 14h14
  2. Legalisation de parc logiciel
    Par NorexaMS dans le forum EDI
    Réponses: 4
    Dernier message: 02/07/2009, 15h32
  3. Cherche logiciel pour tenir à jour un parc
    Par alex_m94 dans le forum Ordinateurs
    Réponses: 5
    Dernier message: 23/05/2009, 10h39
  4. Logiciel Gestion de Parc avec Base AS400
    Par Angeldu74 dans le forum Forum général ERP
    Réponses: 0
    Dernier message: 15/02/2008, 09h43
  5. inventaire logicielle et materielle
    Par Qamalito dans le forum Debian
    Réponses: 2
    Dernier message: 23/11/2007, 13h00

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo