Fichier batch du dos

Fermé
blach ji - 30 mars 2011 à 23:43
jee pee Messages postés 39591 Date d'inscription mercredi 2 mai 2007 Statut Modérateur Dernière intervention 19 avril 2024 - 2 avril 2011 à 18:48
Bonjour, je voudrais realiser un script en bach dos sous windows qui affiche les caracteristique d'un ordinateur (cpu;memoires....).merci d'avance.



A voir également:

3 réponses

BeFaX Messages postés 14245 Date d'inscription mercredi 24 décembre 2008 Statut Contributeur Dernière intervention 6 août 2013 3 812
31 mars 2011 à 00:18
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
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
0
jee pee Messages postés 39591 Date d'inscription mercredi 2 mai 2007 Statut Modérateur Dernière intervention 19 avril 2024 9 225
2 avril 2011 à 18:48
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
0