Fichier batch du dos

Bonjour, je voudrais realiser un script en bach dos sous windows qui affiche les caracteristique d'un ordinateur (cpu;memoires....).merci d'avance.

3 réponses

  1. Modérateur
    Salut,

    Si tu prends tout le source donné par befax et que tu l'enregistres dans un fichier .bat puis que tu l'exécutes cela pour moi répond bien à ta question.

    La première ligne indique une commande pour trouver les infos et les placer dans un fichier et tout le reste du script une méthode pour extraire les infos utiles.

    C'est un super exemple dont tu devrais t'inspirer pour réaliser ta propre procédure.

    cdlt
    1. merci de votre coup de pouce BEFAX.mais moi je veux un fichier de l'extention .bat .que apres l'execution en cmd il va me donner des info sur l'ordinateur :
      1 version windows.
      2 marqueur freqence CPU
      3 marqeur capacite disque dur
      3 marqueur carte grafique
      5 nbre de lecteur USB
      6 nbre memoire(RAM...

      MERCI BCP DE VOTRE REPONSE BEFAX
      1. Contributeur
        Doublon.

        En voici un petit créé par mes soins :
        dxdiag /t %temp%\dxdiag.txt 
        
        (echo. 
        echo  ^|======================================================^| 
        echo  ^|      Résumé de l'ordinateur                          ^| 
        echo  ^|======================================================^| 
        echo  ^|)>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "System Manufacturer"') do echo  ^|  Carte mère  : %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "System Model"') do echo  ^|  Modèle      : %%b >>boot.txt 
        for /f "tokens=1,2,3* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Processor"') do call :del %%b 
        for /f "tokens=1,2* delims=]" %%a in ('type 01.tmp') do ( 
        echo  ^|  Processeur  :  %%a 
        echo  ^|  Modèle      :  %%b 
        )>>boot.txt 
        if exist 01.tmp del /F /Q 01.tmp >NUL 
        goto nextr 
        :del 
        set var=%* 
        set var=%var:     =]% 
        echo %var%>01.tmp 
        goto :eof 
        :nextr 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "   Memory"') do echo  ^|  Mémoire     : %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Machine name"') do echo  ^|  Nom PC      : %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "DirectX Version"') do echo  ^|  DirectX     : %%b >>boot.txt 
        echo  ^|>>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Card name"') do echo  ^|  Carte Graph.: %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Display Memory"') do echo  ^|  Mém. Graph  : %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Monitor Model"') do echo  ^|  Ecran       : %%b >>boot.txt 
        for /f "tokens=1,2* delims=:" %%a in ('type %temp%\dxdiag.txt ^| find "Driver Date/Size"') do echo  ^|  Drivers     : %%b %%c >>boot.txt 
        start boot.txt  
        exit