Prosygma UK Prosygma France Prosygma Italie
    
     Accueil     Commander     Clients     Téléchargements     Contacts     I-mode        Offre spéciale
   Hébergement ASP-PHP
      Pack PRO I
      Pack PRO II
      Pack PRO III
   Hébergement .NET
      Pack .NET I
      Pack .NET II
      Pack .NET III
   Revendeurs
      SEMI-DEDIE I
      SEMI-DEDIE II
      SERVEURS DEDIES
   Hébergement divers
     - WEBDEV
     - STREAMING
   Services
      NOM DE DOMAINE
      HTTPS & SSL
      E-COMMERCE
      SQL SERVEUR
      WEBMAIL
      REFERENCEMENT
      E-SAUVEGARDE
   Les + Prosygma
      NOS TARIFS
      LE RESEAU
      ASSISTANCE
      FORMATIONS
   Outils
      WHOIS
      FAQ
      Aide IIS
      Ressource KIT FP
      Composants ASP
     PARTENAIRES
     
     
     

Solutions hébergement
Support et Assistance technique.
 
Imprimer Sauvegarder Ajouter cette page à vos Favoris :-)
  
  [Merak serveur de mail - Divers]
 
Comment-nettoyer-les-anciens-messages-temporaires-en-fonction-de-leur-date-Anglais-
 
  Old log files on web servers or mail servers can sometimes fill up all available disk space.
One tool you can use is forfiles.exe from the Windows 2000 Resource Kit tools.

To delete all files older than 30 days, use the following command:

Forfiles -p"C:\WINDOWS\system32\Log Files" -s -m*.log -d-30 -c"CMD /C del /Q @FILE"
One thing I noticed is that @FILE has to be all uppercase or else it's not going to work.


Forfiles

Forfiles

Selects files in a folder or tree for batch processing.

Syntax

forfiles [/p Path] [/m SearchMask] [/s] [/c Command] [/d[{+ | -}] [{MM/DD/YYYY | DD}]]

Parameters
/pPath
Specifies the Path on which you want to start searching. The default folder is the current working directory, which you specify by typing a period (.).
/mSearchMask
Searches files according to SearchMask. The default SearchMask is *.*.
/s
Instructs forfiles to search in subdirectories.
/cCommand
Runs the specified Command on each file. You must wrap command strings with spaces in quotation marks. The default Command is "cmd /c echo @file".
/d[{+ | -}] [{MM/DD/YYYY | DD}]
Selects files with a date greater than or equal to (+) or less than or equal to (-) the specified date, where MM/DD/YYYY is the specified date and DD is the current date minus DD days. If you do not specify + or -, + is used. The valid range for DD is 0 - 32768.
/?
Displays help at the command prompt.
Remarks

Forfiles is most commonly used in batch files.

Forfiles /s is similar to dir /s.

The following table list the variables that you can use in the /cCommand command string.

Variable Description

@file

File name

@fname

File name without extension

@ext

File extension

@path

Full path of the file

@relpath

Relative path of the file

@isdir

Evaluates to TRUE if a file type is a directory, otherwise it evaluates to FALSE

@fsize

File size in bytes

@fdate

Last modified date stamp on the file

@ftime

Last modified time stamp on the file

With forfiles, you can run a command on or pass arguments to multiple files. For example, you could run the TYPE command on all files in a tree with the *.txt extension. Or, you could execute every batch file (*.bat) on the C:\ drive with the file name "Myinput.txt" as the first argument.

With forfiles, you can do any of the following:

Select files by an absolute or a relative date using /d.

Build an archive tree of files using variables such as @fsize (file size) and @fdate (file date).

Differentiate files from directories using the @isdir variable.

Format output by including special characters in the command line and surrounding the characters with the hexadecimal code 0xHH.

Forfiles works by implementing the recurse subdirectories flag on tools designed to process only a single file.

Examples

To list all of the batch files on drive C:, type:

forfiles /p c:\ /s /m*.bat /c"cmd /c echo @file is a batch file"

To list all of the directories on drive C:, type:

forfiles /p c:\ /s /m*.* /c"cmd /c if @isdir==true echo @file is a directory"

To list all of the files older than 100 days on drive C:, type:

forfiles /p c:\ /s /m*.* /dt-100 /c"cmd /c echo @file : date >= 100 days"

To list all of the files older than January 1, 1993 on drive C:, and then display "file is quite old!" for files with a date older than 01/01/1993, type:

forfiles /p c:\ /s /m*.* /dt-01011993 /c"cmd /c echo @file is quite old!"

To list all of the extensions of all of files on drive C: in column format, type:

forfiles /p c:\ /s /m*.* /c "cmd /c echo extension of @file is 0x09@ext0x09" With:

To list all of the batch files on drive C:, type:

forfiles /p c:\ /s /m *.bat /c "cmd /c echo @file is a batch file"

To list all of the directories on drive C:, type:

forfiles /p c:\ /s /m *.* /c "cmd /c if @isdir==true echo @file is a directory"

To list all of the files older than 100 days on drive C:, type:

forfiles /p c:\ /s /m *.* /d t-100 /c "cmd /c echo @file : date >= 100 days"

To list all of the files older than January 1, 1993 on drive C:, and then display "file is quite old!" for files with a date older than 01/01/1993, type:

forfiles /p c:\ /s /m *.* /d t-01011993 /c "cmd /c echo @file is quite old!"

To list all of the extensions of all of files on drive C: in column format, type:

forfiles /p c:\ /s /m*.* /c "cmd /c echo extension of @file is 0x09@ext0x09"

Formatting legend

Format Meaning

Italic

Information that the user must supply

Bold

Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output


retour


Nos serveurs sont désormais des serveurs
Pentium 3 Ghz, 1 Go Ram

 La formule de base est à 10 Euros TTC / mois
Si vous avez des besoins plus spécifiques (composants, espace disque...), nous sommes la pour répondre à vos questions.
Rappel : les frais d'installation sont gratuits


Prosygma Hébergeur ASP élu meilleur site.
 
Trois nouveaux composants ASP sont désormais en place sur toutes nos formules.Il s'agit de ASPIMAGE, ASPPOP3 et ASPMAIL.


La dernière version de Microsoft® .NET Framework contient tout ce qu'il vous faut pour faire fonctionner des applications .NET Framework est disponible sur nos serveurs

Cliquez içi pour commander votre hébergement .Net

Votre nom de domaine en .com, .net ou .org au prix unique : 20 Euros

  Vérifiez la disponibilité d'un nom de domaine