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 :

Aide pour un script pour récupérer des infos sur un poste


Sujet :

VBScript

  1. #1
    Futur Membre du Club
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Octobre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Octobre 2012
    Messages : 2
    Points : 6
    Points
    6
    Par défaut Aide pour un script pour récupérer des infos sur un poste
    Bonjour à la communauté

    Je suis novice en vbs et récupère des exemples a droite a gauche en essaynt de les compiler pour obtenir le script avec la fonction que je recherche.
    Dans la cadre de mon activité, il me faudrait un script qui me permette de d'afficher à l'utilisateur des infos sur son poste.
    J'ai trouvé un script qui me permet de récupérer l'IP, l'adresse MAC, le nom de l'ordinateur et le système d'exploitation.
    Le seul problème c'est que j'ouvre 2 pop up d'information.
    J'ai donc tenter de les compiler pour n'avoir q'un seul pop up.
    C'est là que je rencontre des problèmes car mon script ne fonctionne pas.
    Je me retrouve avec l'erreur 'Next' Attendu sans savoir pourquoi.
    Je pense que mes compétences sont trop faible et j'en suis même sur.

    Voici le script :

    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
    'Informations sur votre système d'exploitation
     
    On Error Resume Next
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
     
    strComputer = env.Item("Computername")
     
    Dim objWMIService
    Dim colItems, objItem
     
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
     
    For Each objItem in colItems
        WScript.Echo "Informations OS" & VbCr & _
        "Systeme d'Exploitation: " & objItem.Caption & VbCr & _
        ""
    set wshnetwork=wscript.createobject("wscript.network")
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colAdapters = objWMIService.ExecQuery _
        ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    n = 1
    For Each objAdapter in colAdapters
    msgbox "Nom de l'ordinateur: "  &wshnetwork.computername & vbcr & vbcr &"Systeme d'Exploitation: " & objItem.Caption & VbCr &"Adresse MAC: "   & objAdapter.MACAddress & vbcr& vbcr &"Adresse IP: " & objAdapter.IPAddress(i) 
     
    Next
    Voilà, j'en appel a votre savoir pour me donner la direction à suivre pour résoudre mon problème de script.

    Dans l'attente de vous lire.

    Krumpir

  2. #2
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 839
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 839
    Points : 9 222
    Points
    9 222
    Par défaut
    et bienvenue sur DVP
    Il faut indenter votre code pour qu'il soit plus lisible pour vous et pour les autres, par exemple un service en ligne pour indenter rapidement vos codes sources http://vbindent.com/
    et aussi il faut éliminer On Error resume Next car vous ne pouvez pas déboguer facilement vos erreurs avec cette instruction, mais je vous conseille de prendre l'habitude d'utiliser Option Explicit
    Testez ce code :
    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
    'Informations sur votre système d'exploitation
    Option Explicit
    Dim objWMIService,oShell,env,colAdapters,Titre,i,fso,LogFile
    Dim colItems,objItem,strComputer,MyInfos,wshnetwork,objAdapter
    Titre = "PC Infos"
    strComputer = "."
    set fso = CreateObject("Scripting.FileSystemObject")
    'Nom du fichier qui va stocker le résultat
    LogFile = Left(Wscript.ScriptFullName,InstrRev(Wscript.ScriptFullName, ".")) & "txt"
    if fso.FileExists(LogFile) Then 'Si le fichier LogFile existe 
    	fso.DeleteFile LogFile 'alors on le supprime
    end If
    set wshnetwork = createobject("wscript.network")
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
     
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery _
    ("Select * from Win32_OperatingSystem")
     
    For Each objItem in colItems
    	Set colAdapters = objWMIService.ExecQuery _
    	("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
    	For Each objAdapter in colAdapters
    		MyInfos = "Informations OS " & VbCrLF & VbCrLF & _
    		"Système d'Exploitation : " & objItem.Caption & VbCrLF &  VbCrLF & "Nom de l'ordinateur : " & wshnetwork.computername & VbCrLF & VbCrLF &_
    		"Adresse MAC : "   & objAdapter.MACAddress & VbCrLF & VbCrLF &_
    		"Adresse IP : " & objAdapter.IPAddress(i) 
    	Next
    Next
    Call WriteLog(MyInfos,LogFile)
    MsgBox MyInfos,64,Titre
    oShell.Run LogFile,1,False
    '*****************************************************************
    'Fonction pour écrire le résultat dans un fichier texte
    Sub WriteLog(strText,LogFile)
    	Dim fs,ts 
    	Const ForAppending = 8
    	Set fs = CreateObject("Scripting.FileSystemObject")
    	Set ts = fs.OpenTextFile(LogFile,ForAppending,True)
    	ts.WriteLine strText
    	ts.Close
    End Sub
    '*****************************************************************

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Octobre 2007
    Messages
    22
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2007
    Messages : 22
    Points : 27
    Points
    27
    Par défaut
    Bonjour,

    Il faut relire pas à pas un code et idéalement essayer de comprendre les instructions.

    Voici le code nettoyé de variables inutiles à première vue, et il est dommage de répéter les infos sur l'OS si on a plusieurs cartes réseaux.
    (exemple : objAdapter.IPAddress(i) => i sera toujours à 0 dans ce code)

    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
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
     
    strComputer = env.Item("Computername")
     
    Dim objWMIService
    Dim colItems, objItem
    Dim strOutput
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
     
    For Each objItem in colItems
    	set wshnetwork=wscript.createobject("wscript.network")
    	strComputer = "."
    	Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
    	Set colAdapters = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
     
    	strOutput = strOutput & _
    	"Nom de l'ordinateur: "  &wshnetwork.computername & vbcr & _
    	"Systeme d'Exploitation: " & objItem.Caption & vbcr
     
    	strOutput = strOutput & vbCr
     
    	For Each objAdapter in colAdapters
    		strOutput = strOutput & _
    		"Adresse MAC: "   & objAdapter.MACAddress & vbcr & _
    		"Adresse IP: " & objAdapter.IPAddress(0) & vbcr
    	Next
    Next
     
    MsgBox strOutput

    Bonne journée !

    Edit : hackoofr a été plus rapide

  4. #4
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 839
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 839
    Points : 9 222
    Points
    9 222
    Par défaut
    Citation Envoyé par Zelnist Voir le message
    Edit : hackoofr a été plus rapide
    Et plus rapide aussi, de voter +1 pour vous
    Bonne Journée !

  5. #5
    Futur Membre du Club
    Homme Profil pro
    Technicien maintenance
    Inscrit en
    Octobre 2012
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Technicien maintenance
    Secteur : High Tech - Matériel informatique

    Informations forums :
    Inscription : Octobre 2012
    Messages : 2
    Points : 6
    Points
    6
    Par défaut
    Super
    Merci beaucoup pour vos conseils.
    On vient de me demander de rajouter l'information du proxy utiliser par le navigateur.
    Je pense que je m'en sors pas mal.
    Je vous mets le script final pour ceux a qui ca pourrais servir.

    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
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
     
    strComputer = env.Item("Computername")
     
    Dim objWMIService
    Dim colItems, objItem
    Dim strOutput
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
     
    For Each objItem in colItems
    	set wshnetwork=wscript.createobject("wscript.network")
    	strComputer = "."
    	Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
    	Set colAdapters = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
     
    	strOutput = strOutput & _
    	"Nom de l'ordinateur: "  &wshnetwork.computername & vbcr & _
    	"Systeme d'Exploitation: " & objItem.Caption & vbcr
     
    	strOutput = strOutput & vbCr
     
    	For Each objAdapter in colAdapters
    		strOutput = strOutput & _
    		"Adresse MAC: "   & objAdapter.MACAddress & vbcr & _
    		"Adresse IP: " & objAdapter.IPAddress(0) & vbcr
    	Next
    Next
     
     Set fs = CreateObject("Scripting.FileSystemObject" )
    set c=CreateObject("WScript.Shell" )
     
    AutoConfigURL = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
     
    If ExisteCle(AutoConfigURL) = true then 
    	AC = c.RegRead(AutoConfigURL)
    Else
    	AC = "Pas configuré"
    End if
     
     
    Pxysvr = "Proxy Server : " & AC
     
     
    MsgBox strOutput & Pxysvr
     
    Function ExisteCle( stKey)
    On Error Resume Next
    	Dim WshShell
    	Set WshShell = WScript.CreateObject("WScript.Shell")
    	WshShell.RegRead stKey
    	ExisteCle = (Err = 0)
    End function
    Encore merci pour vos conseils et votre réactivité.

    Krumpir

  6. #6
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 839
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 839
    Points : 9 222
    Points
    9 222
    Par défaut

    Si vous voulez ajouter d'autres infos et créer un rapport texte :
    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
    Set oShell = CreateObject("wscript.Shell")
    Set env = oShell.environment("Process")
     
    strComputer = env.Item("Computername")
     
    Dim objWMIService
    Dim colItems, objItem
    Dim strOutput
    Set objWMIService = GetObject("winmgmts:\\"&  strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem")
     
    For Each objItem in colItems
    	set wshnetwork=wscript.createobject("wscript.network")
    	strComputer = "."
    	Set objWMIService = GetObject("winmgmts:\\"& strComputer & "\root\cimv2")
    	Set colAdapters = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
     
    	strOutput = strOutput & _
    	"Nom de l'ordinateur: "  &wshnetwork.computername & vbcr & _
    	"Systeme d'Exploitation: " & objItem.Caption & vbcr
     
    	strOutput = strOutput & vbCr
     
    	For Each objAdapter in colAdapters
    		strOutput = strOutput & _
    		"Adresse MAC: "   & objAdapter.MACAddress & vbcr & _
    		"Adresse IP: " & objAdapter.IPAddress(0) & vbcr
    	Next
    Next
     
     Set fs = CreateObject("Scripting.FileSystemObject" )
    set c=CreateObject("WScript.Shell" )
     
    AutoConfigURL = "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer"
     
    If ExisteCle(AutoConfigURL) = true then 
    	AC = c.RegRead(AutoConfigURL)
    Else
    	AC = "Pas configuré"
    End if
     
     
    Pxysvr = "Proxy Server : " & AC
     
     
    MsgBox strOutput & Pxysvr
     
    Function ExisteCle( stKey)
    On Error Resume Next
    	Dim WshShell
    	Set WshShell = WScript.CreateObject("WScript.Shell")
    	WshShell.RegRead stKey
    	ExisteCle = (Err = 0)
    End function
    '***************************************Autres Infos****************************************************
    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")
     
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
     
    report = report & "******************************************" & vbCrLf
    report = report & " - Information  de l'ordinateur " & strComputer & " - " & vbCrLf
    report = report & "******************************************" & vbCrLf & vbCrLf
     
     
    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.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 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"
     
            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
     
    srComputer = "."
    Set objWMIService = GetObject("winmgmts:" & "!\\" & srComputer & "\root\cimv2")
    Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled = True") 
    For Each objAdapter in colAdapters
        IPdebut = LBound(objAdapter.IPAddress)
        IPfin = UBound(objAdapter.IPAddress)
        If (objAdapter.IPAddress(IPdebut) <> "") then
            For i = IPdebut To IPfin
                msg =  msg  & "utilise l'adresse IP " & objAdapter.IPAddress(i) & vbCrLf
            Next     
        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("inventaire" & strComputer & ".txt") Then
        set ts = fso.CreateTextFile("inventaire_" & strComputer & ".txt", True)
    Else
        set ts = fso.OpenTextFile("inventaire_" & strComputer & ".txt", 2, True)
    End If
    'Wscript.Echo msg
    ts.write report
    ts.write software
    ts.write msg
    Set ws = CreateObject("wscript.shell")
    ws.run "notepad inventaire_" & strComputer & ".txt"

  7. #7
    Expert éminent
    Avatar de hackoofr
    Homme Profil pro
    Enseignant
    Inscrit en
    Juin 2009
    Messages
    3 839
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 48
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Enseignant

    Informations forums :
    Inscription : Juin 2009
    Messages : 3 839
    Points : 9 222
    Points
    9 222
    Par défaut

    Vous pouvez aussi utiliser ces infos et l'intégrer dans un HTA exemple : PC Information + Process Killer.hta

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Récupérer des infos sur une page externe
    Par Horrigan dans le forum Général JavaScript
    Réponses: 7
    Dernier message: 20/07/2006, 14h46
  2. Tester et récupérer des infos sur fichier distant
    Par cybertj dans le forum Langage
    Réponses: 2
    Dernier message: 17/05/2006, 09h18
  3. Récupérer des infos sur mes sites
    Par meufeu dans le forum Langage
    Réponses: 3
    Dernier message: 27/04/2006, 10h25
  4. [servlet] Récupérer des infos sur le client
    Par kenito dans le forum Servlets/JSP
    Réponses: 4
    Dernier message: 07/09/2005, 18h08
  5. Récupérer des infos sur un AVI
    Par FredericB dans le forum C++Builder
    Réponses: 2
    Dernier message: 08/12/2003, 14h25

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