SUPINFO International University

SUPINFO Institute of Information Technology
Laboratoire Microsoft




Rechercher le nombre de fichiers portant une extension choisie dans un dossier

Accueil > Script > maintenance > Rechercher le nombre de fichiers portant une extension choisie dans un dossier

Rechercher le nombre de fichiers portant une extension choisie dans un dossier

Par Alexandre VILLOING, LABORATOIRE SUPINFO DES TECHNOLOGIES MICROSOFT
Publiée le 07/02/2005 vers 9h.

Description :
Ce script VBS permet de rechercher le nombre de fichiers portant une extension choisie dans un dossier spécifié.

Script :

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService. _ ExecQuery("SELECT * FROM CIM_DataFile WHERE Path = '\\Scripts\\' " & _ "AND Drive = 'C:' AND Extension = 'vbs'")
Wscript.Echo "Number of .txt files found: " & colFiles.Count


Proposer un script

Notre avis :

Votre avis :

Réactions :
0

Votants :
2

Visites :
8909

1
2
3
4
5




Retrouvez ci-dessous les autres sections du Laboratoire Microsoft

Définitions

Accès direct aux définitions :
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Effectuez une recherche dans les définitions :