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 :

Afficher des information sur le PC


Sujet :

VBScript

  1. #21
    Expert éminent


    Profil pro
    Inscrit en
    Juin 2003
    Messages
    14 008
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 14 008
    Par défaut
    Citation Envoyé par imparator_42 Voir le message
    et cest a quelle ligne quil envoit ça ???
    bonjour imparator_42... as-tu vu que tu est dans le forum VBScript ..!!

  2. #22
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Citation Envoyé par imparator_42 Voir le message
    Pour Adresse ip :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
     
    Private Sub Form_Load()
     
    IP.Caption = "Adresse IP de votre ordinateur:" + Winsock1.LocalIP
     
    End sub

    Bon il faut savoir qu'il faut ajouter un label qui porte le nom "IP"...
    Apres tu peux le changer comme tu veux
    Merci encore

    Le script n'affiche rien chez moi

  3. #23
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Citation Envoyé par imparator_42 Voir le message
    et cest a quelle ligne quil envoit ça ???
    la ligne 2 caractére 17

  4. #24
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Citation Envoyé par bbil Voir le message
    bonjour imparator_42... as-tu vu que tu est dans le forum VBScript ..!!
    ah, c'est pas du vbs qui m'a donner ?

  5. #25
    Membre confirmé Avatar de imparator_42
    Homme Profil pro
    Étudiant
    Inscrit en
    Novembre 2007
    Messages
    242
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2007
    Messages : 242
    Par défaut
    Excusez moi, je pas fait tres gaffe ,je coryais quon était sur VB6

  6. #26
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    ok, c'est pas grave, merci quand même

  7. #27
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Vous sauriez comment afficher les conections réseau ?

  8. #28
    Expert éminent


    Profil pro
    Inscrit en
    Juin 2003
    Messages
    14 008
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 14 008
    Par défaut
    Citation Envoyé par koKoTis Voir le message
    Vous sauriez comment afficher les conections réseau ?
    qu'appelle tu les connexions réseaux..?

    as tu regardé la discussion du forum contributions VBscript citée plus haut par Ced600 ? ce script ne te donne t'il pas les résultats escomptés ?

  9. #29
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    ben le nom des connection quoi

    je n'ai rien vu sur la connaction réseau

  10. #30
    Expert confirmé
    Avatar de ced600
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2006
    Messages
    3 364
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Août 2006
    Messages : 3 364
    Par défaut
    Normalement il t'affiche les détails de connnection.
    Je ne sais pas si tu as vu mais le script ne t'affiche rien à l'écran, il enregistre tout dans un fichier inventaire sur c:

    Normalement c'est ce code là :
    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
    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 & "http://www.google.ca/search?hl=fr&rls=GGLD%2CGGLD%3A2004-30%2CGGLD%3Afr&q=winsockfix.exe+download&btnG=Rechercher&meta=" & vbcrlf
    report = report & "- - - - - -" & vbcrlf
    report = report & vbcrlf
    Les deux premières lignes du code précédent sont toujours indispensable pour qu'il fonctionne indépendemment de ton autre code.

    Mais si tu utilises les deux code dans le même script, alors ne qu'une seule fois c'est deux première ligne.

  11. #31
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    encore merci

    J'ai modifier un peut le code: (pour avoir l'affichage dans une fenêtre):

    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
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
     
    For Each objAdapter in colAdapters
     
            If (objAdapter.Manufacturer<>"Microsoft") Then
                    wscript.echo "Nom de la carte/adapteur (Caption): " & objAdapter.Caption & vbcrlf _
                               & "Nom de la carte/adapteur: " & objAdapter.Name & vbcrlf _
                               & "Type de la carte/adapteur: " & objAdapter.AdapterType & vbcrlf _
                               & "État actuel: " & objAdapter.Availability & vbcrlf _
                               & "Description: " & objAdapter.Description & vbcrlf _
                               & "Adresse MAC: " & objAdapter.MACAddress & vbcrlf _
                               & "Adresse réseau de la carte: " & objAdapter.NetworkAddresses & vbcrlf _
                               & "Adresse préprogrammée: " & objAdapter.PermanentAddress & vbcrlf _
                               & "Nom du fabricant: " & objAdapter.Manufacturer & vbcrlf _
                               & "Nom du produit: " & objAdapter.ProductName & vbcrlf _
                               & "Nom de service: " & objAdapter.ServiceName & vbcrlf _
                               & "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
     
                                    wscript.echo "Adresse IP: " & objAdapterConf.IPAddress & vbcrlf _
                                               & "Masque de sous-réseau: " & objAdapterConf.IPSubnet & vbcrlf _
                                               & "Le DHCP (Attribution automatique d'une adresse IP par un serveur DHCP) est-il activé:" & vbCrLf _
                                               & objAdapterConf.DHCPEnabled & vbcrlf _
                                               & "Serveur DHCP: " & objAdapterConf.DHCPServer & vbcrlf _
                                               & "Serveur(s) DNS: " & objAdapterConf.DNSServerSearchOrder & vbcrlf _
     
                            End If
     
                    Next
     
     
            End If
     
    Next
    Mais j'ai cette erreur:


  12. #32
    Expert confirmé
    Avatar de ced600
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2006
    Messages
    3 364
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Août 2006
    Messages : 3 364
    Par défaut
    En première ligne

  13. #33
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    encore merci

    le script fonctione mais il renvoie cette erreur a la fin:

  14. #34
    Expert confirmé
    Avatar de ced600
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2006
    Messages
    3 364
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Août 2006
    Messages : 3 364
    Par défaut
    Avec les _ je me perds dans les compte, c'est koi la ligne 34 ?

  15. #35
    Membre chevronné
    Inscrit en
    Août 2007
    Messages
    302
    Détails du profil
    Informations personnelles :
    Âge : 58

    Informations forums :
    Inscription : Août 2007
    Messages : 302
    Par défaut
    Salut,

    tu as le scriptomatic de crosoft qui te fait tout ca et te génère le code qui va bien en VBS, Python JScript ou Perl, juste à toi de te placer dans la bonne classe WMI :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://www.microsoft.com/downloads/details.aspx?familyid=09dfc342-648b-4119-b7eb-783b0f7d1178&displaylang=en
    A++

  16. #36
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Citation Envoyé par ced600 Voir le message
    Avec les _ je me perds dans les compte, c'est koi la ligne 34 ?
    de cette ligne tu parle ?

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
                                    wscript.echo "Adresse IP: " & objAdapterConf.IPAddress & vbcrlf _
    Le _ c'est pour pouvoir aller a la ligne dans le script dans le même wscript.echo, mais j ne croi pas que c'est ce que tu veut savoir, si ?

  17. #37
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    Citation Envoyé par RadPAT Voir le message
    Salut,

    tu as le scriptomatic de crosoft qui te fait tout ca et te génère le code qui va bien en VBS, Python JScript ou Perl, juste à toi de te placer dans la bonne classe WMI :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    http://www.microsoft.com/downloads/details.aspx?familyid=09dfc342-648b-4119-b7eb-783b0f7d1178&displaylang=en
    A++

    merci

    mais je ne connait rien au classes WMI

  18. #38
    Membre chevronné
    Inscrit en
    Août 2007
    Messages
    302
    Détails du profil
    Informations personnelles :
    Âge : 58

    Informations forums :
    Inscription : Août 2007
    Messages : 302
    Par défaut
    Citation Envoyé par koKoTis Voir le message
    merci

    mais je ne connait rien au classes WMI
    et quand tu fais :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colAdapters = objWMIService.ExecQuery("Select * from Win32_NetworkAdapter")
    c'est quoi à ton avis ?

    C'est pas grave télécharge le bouzin et dans la listbox de gauche de scriptomatic, choisis "Win32_NetworkAdapter" puis cliques sur le bouton "Run" et la lumière viendra vers toi

    A++

  19. #39
    Membre éprouvé
    Avatar de koKoTis
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 438
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 438
    Par défaut
    merci je regarderai ca se soir

  20. #40
    Expert confirmé
    Avatar de ced600
    Homme Profil pro
    Développeur .NET
    Inscrit en
    Août 2006
    Messages
    3 364
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : France

    Informations professionnelles :
    Activité : Développeur .NET

    Informations forums :
    Inscription : Août 2006
    Messages : 3 364
    Par défaut
    Bha je voulais savoir à koi correspond la ligne de l'erreur, j'ai du mal à compter !!!

    WMI est Windows Management Instrumentation, c'est des classes misent à disposition pour faire un tas de truc comme obtenir une adresse IP.
    Bref tu l'utilises depuis départ quasiment dans les script.
    Je n'ai juste jamais prononcé le mot, car vu qu'il te manque quelque base, j'avais peur de te perdre

Discussions similaires

  1. Réponses: 1
    Dernier message: 18/12/2016, 17h55
  2. [AJAX] Afficher des informations sur la même page
    Par Majinpsy dans le forum AJAX
    Réponses: 2
    Dernier message: 05/02/2014, 11h16
  3. Afficher des informations sur le bureau
    Par bdaboah dans le forum Windows XP
    Réponses: 4
    Dernier message: 16/06/2011, 16h18
  4. Réponses: 0
    Dernier message: 22/06/2010, 15h57
  5. Réponses: 23
    Dernier message: 16/03/2010, 15h19

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