Batch - besoin aide svp

Flo313Z -  
 Flo313Z -
Bonjour a tous,

Etant de nature faignant et ayant marre de copier toute les semaines les fichiers stocker sur mon PC, j' ai décidé de créer une application pour me simplifier la vie (en batch).

Voilà pour le moment :

----------------------------------------------------------------------------------------------------------------
:MENU
ECHO -------------------------------------------------------------------------------
ECHO Installation Automatique MSI
ECHO \ Creer par Flo313Z /
ECHO -------------------------------------------------------------------------------
ECHO 1 - Installation automatique pilote MSIx64
ECHO 2 - Installation automatique logiciel Flo
ECHO 3 - Installation automatique logiciel Libre
ECHO 4 - Installation semi-automatique logiciel
ECHO 5 - Jeux
ECHO 6 - Charger ASUS
ECHO 7 - Sauvegarde ASUS <--(c' est celui là qui m'interesse:)
ECHO 8 - Charger MSI
ECHO 9 - Sauvegarde MSI
ECHO 0 - Exit

set /p QMenu=Que voulez-vous faire :
if %QMenu%==1 goto PILOTE_MSIx64
if %QMenu%==2 goto LOGFLO
if %QMenu%==3 goto LOGLIBRE
if %QMenu%==4 goto SEMI-AUTO
if %QMenu%==5 goto JEUX
if %QMenu%==6 goto CHARGER_ASUS
if %QMenu%==7 goto SAUVEGARDE_ASUS
if %QMenu%==8 goto CHARGER_MSI
if %QMenu%==9 goto SAUVEGARDE_MSI
if %QMenu%==0 goto EXIT
GOTO MENU

:EXIT
EXIT

:SAUVEGARDE_MSI
ECHO -------------------------------------------------------------------------------
ECHO 9 - Sauvegarde MSI en cours...

----------------------------------------(Ce qui me manque)----------------------------------------------

xcopy "%USERPROFILE%\Desktop" ".\Sauvegarde\MSI_FLO1\Desktop" /S /I /Y
xcopy "%USERPROFILE%\Emploi" ".\Sauvegarde\MSI_FLO1\Emploi" /S /I /Y
xcopy "%USERPROFILE%\Liens" ".\Sauvegarde\MSI_FLO1\Liens" /S /I /Y
xcopy "%USERPROFILE%\Ma musique" ".\Sauvegarde\MSI_FLO1\Ma musique" /S /I /Y
xcopy "%USERPROFILE%\Mes documents" ".\Sauvegarde\MSI_FLO1\Mes documents" /S /I /Y
xcopy "%USERPROFILE%\Mes images" ".\Sauvegarde\MSI_FLO1\Mes images" /S /I /Y
xcopy "%USERPROFILE%\Mes videos" ".\Sauvegarde\MSI_FLO1\Mes videos" /S /I /Y
xcopy "%USERPROFILE%\Programmation" ".\Sauvegarde\MSI_FLO1\Programmation" /S /I /Y
xcopy "%USERPROFILE%\Saves Games" ".\Sauvegarde\MSI_FLO1\Saves Games" /S /I /Y
xcopy "%USERPROFILE%\Cours" ".\Sauvegarde\MSI_FLO1\Cours" /S /I /Y
xcopy "%USERPROFILE%\Telechargement" ".\Sauvegarde\MSI_FLO1\Telechargement" /S /I /Y
ECHO Terminer
ECHO -------------------------------------------------------------------------------
PAUSE
GOTO MENU
----------------------------------------------------------------------------------------------------------------

Pour le moment tout va bien.
Toujours de plus en plus faignant je souhaite que ce programme :

- Compte le nombre de dossier a la racine de Sauvegarde et l'ecrire dans (Compteur_Flo.txt).
- En fonction de la valeur (Compteur_Flo.txt), je souhaite créer un nouveau dossier MSI_FLO2 pour sauvegarder à nouveau.
- Puis pour terminer, je souhaite qu'au cour de la 4eme sauvegardes (MSI_Flo4), le Dossier le plus ancien (MSI_Flo1) soit supprimé.

j'ai commencé un truc mais c'est incomplet...zzzz

----------------------------------------------------------------------------------------------------------------
echo off
set variable=0
for %%a in ('type ".\Sauvegarde\Compteur_Flo.txt"') do set /a variable+=1
dir ".\Sauvegarde" /A-D >.\Sauvegarde\Compteur_Flo.txt

MD ".\Sauvegarde\ASUS_DAP%variable%"

if %variable%>=3
else (
del %DATE%
)
then
(
GOTO MENU
)
----------------------------------------------------------------------------------------------------------------

Une nuit de sommeil m'éclaircira surement les idées...zzzz

d'ici là si vous avez des idées ca serai sympas
merci d'avance

5 réponses

  1. Flo313Z
     
    Je tiens un truc mais mon incrémentation fonctionne mal
    --------------------------------------------------------------------------------------------------------
    @echo off

    if not exist ".\Compteur_Flo.txt" GOTO Compteur_Flo
    :Compteur_Flo
    echo 1 > ".\Compteur_Flo.txt"
    else (
    GOTO Boucle_Flo
    )
    :Boucle_Flo
    set /A nombre=".\Compteur_Flo.txt"
    if not exist ".\MSI_FLO%nombre%.txt" GOTO MD_Flo
    else (
    set /a nombre+=1
    dir /a-d %nombre% > ".\MSI_FLO%nombre%.txt"
    GOTO Boucle_Flo
    )
    :MD_Flo
    MD ".\MSI_FLO%nombre%"

    --------------------------------------------------------------------------------------------------------
    un petit coup de main serai pas de refus ;)
    0
    1. Flo313Z
       
      voici la version amélioré (incrémentation marche toujours pas:(
      --------------------------------------------------------------------------------------------------------
      @echo off

      if not exist ".\Compteur_Flo.txt" (
      echo 1 > ".\Compteur_Flo.txt"
      ) else (
      GOTO incrementation
      )
      :Boucle_Flo
      set /A nombre=".\Compteur_Flo.txt"
      if not exist ".\MSI_FLO%nombre%.txt" (
      MD ".\MSI_FLO%nombre%"
      ) else (
      :incrementation
      set /a %nombre%+=1
      dir /a-d %nombre% > ".\MSI_FLO%nombre%.txt"
      GOTO Boucle_Flo
      )
      echo %nombre%
      pause
      --------------------------------------------------------------------------------------------------------
      PROBLEME : le CMD dit :
      il manque une opérande
      ???
      le sous répertoire existe déjà
      ???
      le but est incrémenté le nom du fichier (MSI_FLO1, MSI_FLO2, ect...)

      pourquoi ca marche pas...svp
      0
    2. Flo313Z
       
      j' ai presque trouvé (marche 2 fois)
      ------------------------------------------------------------------------------------------------------------------------------------
      @echo off

      set /A nombre=".\Compteur_Flo.txt"
      if not exist ".\Compteur_Flo.txt" (
      echo 1 > ".\Compteur_Flo.txt"
      ) else (
      set /a nombre+=1
      )
      :Boucle_Flo
      if not exist ".\MSI_FLO%nombre%.txt" (
      MD ".\MSI_FLO%nombre%"
      ) else (
      set /a nombre+=1
      dir /a-d %nombre% > ".\MSI_FLO%nombre%.txt"
      GOTO Boucle_Flo
      )
      pause
      -----------------------------------------------------------------------------------------------------------------------------------
      prb au niveau de incrementation
      Compteur_Flo.txt ne change pas

      une idée ?
      0
    3. Flo313Z
       
      --------------------------------------------------------------------------------------------------------------------------------
      @echo off

      set /A nombre=".\Compteur_Flo.txt"
      if not exist ".\Compteur_Flo.txt" (
      echo 1 > ".\Compteur_Flo.txt"
      ) else (
      set /a nombre+=1
      GOTO Boucle_Flo
      )
      :Boucle_Flo
      if not exist ".\MSI_FLO%nombre%" (
      MD ".\MSI_FLO%nombre%"
      ) else (
      set /a nombre+=1
      echo %nombre% > ".\Compteur_Flo.txt"
      GOTO Boucle_Flo
      )
      ------------------------------------------------------------------------------------------------------------------------------------
      Ca marche !!!!!!!!!!!!!!
      0
  2. Flo313Z
     
    IL ME MANQUE :

    - Puis pour terminer, je souhaite qu'au cour de la 4eme sauvegardes (MSI_Flo4), le Dossier le plus ancien (MSI_Flo1) soit supprimé.

    je continue mes recherches...
    0
    1. Flo313Z
       
      problème supprime que intérieur du dossier
      ------------------------------------------------------------------------------------------------------------------------------------
      @ECHO off

      SET /a nombre=".\Compteur_Flo.txt"
      IF NOT EXIST ".\Compteur_Flo.txt" (
      ECHO 1 > ".\Compteur_Flo.txt"
      ) ELSE (
      SET /a nombre+=1
      GOTO Boucle_Flo
      )
      :Boucle_Flo
      IF NOT EXIST ".\MSI_FLO%nombre%" (
      MD ".\MSI_FLO%nombre%"
      ) ELSE (
      SET /a nombre+=1
      ECHO %nombre% > ".\Compteur_Flo.txt"
      GOTO Boucle_Flo
      )
      SET /a supprimer=%nombre%-3
      IF EXIST ".\MSI_FLO%nombre%" (
      DEL /s".\MSI_FLO%supprimer%"
      ) ELSE (
      GOTO MENU
      )
      ------------------------------------------------------------------------------------------------------------------------------------
      0
    2. ken dumoulin Messages postés 60 Statut Membre 4
       
      Bonsoir,
      C'est rd /s /q pour les repertoires non?
      0
    3. Flo313Z
       
      désoler je fait du batch depuis 3 jours...
      DEL-->fichier
      RMDIR-->Dossier

      le correcteur orthographe du site m'insulte des que je pose du code
      comment faire...
      0
    4. Flo313Z
       
      c'est bon
      0
  3. Flo313Z
     
    --------------------------------------------------------------------------------------------------------
    @ECHO off
    
    SET /a nombre=".\Compteur_Flo.txt"
    IF NOT EXIST ".\Compteur_Flo.txt" (
    	ECHO 1 > ".\Compteur_Flo.txt"
    ) ELSE (
    	SET /a nombre+=1
    	GOTO Boucle_Flo
    	   )
    :Boucle_Flo
    IF NOT EXIST ".\MSI_FLO%nombre%" (
    	MD ".\MSI_FLO%nombre%"
    ) ELSE (
    	SET /a nombre+=1
    	ECHO %nombre% > ".\Compteur_Flo.txt"
    GOTO Boucle_Flo
    )
    SET /a supprimer =%nombre%-3
    IF EXIST ".\MSI_FLO%nombre%" (
    	RMDIR /Q ".\MSI_FLO% supprimer%"
    ) ELSE (
    	GOTO MENU
    )
    pause
    

    --------------------------------------------------------------------------------------------------------
    voilà
    le problème la c'est que mon compteur redémarre à zéro

    je c' est pas trop comment empêcher cela
    une idée ??
    0
    1. Flo313Z
       
      j'ai essayé de creer un deuxième compteur (compteur_Flo_Del.txt) pour pouvoir le soustraire avec (Compteur_Flo.txt) et ainsi pouvoir supprimé mon dossier MSI_FLO (le 3eme plus vieux) mais ca marche pas :(
      0
    2. Flo313Z
       
      j' ai eu cette idée ce matin
      au lieu de créer un nouveau compteur je vais tous simplement le soustraire mais sans sauvegarder la valeur
      ------------------------------------------------------------------------------------------------------------------------------------
      @ECHO off
      SET /a nombre=".\Compteur_Flo.txt"
      IF NOT EXIST ".\Compteur_Flo.txt" (
      	ECHO 1 > ".\Compteur_Flo.txt"
      ) ELSE (
      	SET /a nombre+=1
      	GOTO Boucle_Flo1
      )
      
      :Boucle_Flo1
      IF NOT EXIST ".\MSI_FLO%nombre%" (
      	MD ".\MSI_FLO%nombre%"
      ) ELSE (
      	SET /a nombre+=1
      	ECHO %nombre% > ".\Compteur_Flo.txt"
      echo %nombre%
      pause
      	GOTO Boucle_Flo2
      )
      :Boucle_Flo2
      SET /a Trois=3
      IF /I nombre GEQ Trois      <--PROBLEME
      	SET /A nombre-=3
      	RMDIR /Q ".\" "MSI_FLO%nombre%"
      ) ELSE (
      	SET /a nombre+=1
      echo %nombre%
      pause
      	GOTO MENU
      )
      

      ------------------------------------------------------------------------------------------------------------------------------------
      je croix que ça marche pas parce que c'est pas des nombres
      la j'aurai vraiment besoin d'un petit coup de main svp
      0
    3. Flo313Z
       
      ------------------------------------------------------------------------------------------------------------------------------------
      :Boucle_Flo2 
      IF /I %nombre% GEQ 3 
       SET /A nombre=nombre-3 
       RMDIR /Q ".\" "MSI_FLO%nombre%" 
      echo %nombre% 
      pause 
       GOTO MENU 
      ) 
      

      ------------------------------------------------------------------------------------------------------------------------------------
      Grrrrrrrrr
      marche pas !!!!
      0
  4. ken dumoulin Messages postés 60 Statut Membre 4
     
    Et oui c'est pointilleux le batch, je viens de chercher pour toi, c'est noel :D
    Chez moi ça ça marche :

    @echo off
    IF NOT EXIST ".\Compteur_Flo.txt" ECHO 0 > ".\Compteur_Flo.txt"
    set nombre=
    set /P nombre=<Compteur_Flo.txt
    set /A nombre=%nombre%+1
    echo %nombre% > Compteur_Flo.txt
    0
    1. Flo313Z
       
      ------------------------------------------------------------------------------------------------------------------------------------
      @ECHO off
      
      SET /p nombre=<".\Compteur_Flo.txt"
      IF NOT EXIST ".\Compteur_Flo.txt" ECHO 1 > ".\Compteur_Flo.txt"
      ) ELSE (
      	SET /a nombre+=1
      	ECHO %nombre% > ".\Compteur_Flo.txt"
      	GOTO Boucle_Flo1
      )
      
      :Boucle_Flo1
      IF NOT EXIST ".\MSI_FLO%nombre%" (
      	MD ".\MSI_FLO%nombre%"
      ) ELSE (
      	SET /a nombre+=1
      	ECHO %nombre% > ".\Compteur_Flo.txt"
      	GOTO Boucle_Flo2
      )
      <--------------------c'est a partir de la le probleme----------------------->
      :Boucle_Flo2
      IF /I %nombre% GEQ 3
      	SET /A nombre=%nombre%-3
      	RMDIR /Q ".\" "MSI_FLO%nombre%"
      echo %nombre%
      pause
      	GOTO MENU
      )
      :MENU
      
      

      ------------------------------------------------------------------------------------------------------------------------------------
      ce que je souhaite faire c'est qu'au bout du 3eme dossier créé, le dossier le plus vieux ce supprime
      mais la...je vois pas

      merci a ken dumoulin de m'avoir aidé
      et encore une fois merci a ken dumoulin de ces interventions

      Parce que je s'en lui me s'en un peu seul sur le forum:(
      0
    2. Flo313Z
       
      C'est le DO qui manque !!
      je les eu dans le DO toute la journée !!!
      0
  5. Vous n’avez pas trouvé la réponse que vous recherchez ?

    Posez votre question
  6. Flo313Z
     
    TROUVER
    voilà les fruits de mon dur labeur (je n'y connaissais rien il y a 4 jours)
    (a mettre a la racine de votre disque dur externe par exemple:)
    ----------------------------------------------------------------------------------------------------
    @ECHO off
    :MENU
    ECHO -------------------------------------------------------------------------------
    ECHO                          Installation Automatique MSI
    ECHO                             \ Creer par Flo313Z /
    ECHO -------------------------------------------------------------------------------
    ECHO 1 - Installation automatique pilote MSIx64
    ECHO 2 - Installation automatique logiciel Flo
    ECHO 8 - Charger MSI
    ECHO 9 - Sauvegarde MSI
    ECHO 0 - Exit
    
    set /p QMenu=Que voulez-vous faire : 
    if %QMenu%==1 goto PILOTE_MSIx64
    if %QMenu%==2 goto LOGFLO
    if %QMenu%==8 goto CHARGER_MSI
    if %QMenu%==9 goto SAUVEGARDE_MSI
    if %QMenu%==0 goto EXIT 
    GOTO MENU
    
    :EXIT 
    EXIT
    
    :PILOTE_MSIx64
    ECHO -------------------------------------------------------------------------------
    ECHO 1 - Installation automatique pilote MSIx64
    ECHO en cours... (0/7)
    start /wait ".\MSI_Pilote64bits\Wireless_15.2.0_s64.exe" /passive /noreboot
    ECHO en cours... (1/7)
    start /wait ".\MSI_Pilote64bits\Win7Vista_64_152254.exe" /passive /noreboot
    ECHO en cours... (2/7)
    start /wait ".\MSI_Pilote64bits\Vista_Win7_Win8_R270.exe" /passive /noreboot
    ECHO en cours... (3/7)
    start /wait ".\MSI_Pilote64bits\STOR_Win7_XP_11.2.0.1006.exe" /passive /noreboot
    ECHO en cours... (4/7)
    start /wait ".\MSI_Pilote64bits\MEI_ALLOS_6.1.0.1042_PV.exe" /passive /noreboot
    ECHO en cours... (5/7)
    start /wait ".\MSI_Pilote64bits\Install_Win7_7058_05212012\setup.exe" /passive /noreboot
    ECHO en cours... (6/7)
    start /wait ".\MSI_Pilote64bits\306.97-notebook-win8-win7-winvista-64bit-international-whql.exe" /passive /noreboot
    ECHO en cours... (7/7)
    start /wait ".\Logiciel\directx-setup.exe" /passive /noreboot
    ECHO Terminer
    
    set /p SHUTDOWN=Voulez-vous redemarer maintenant : (o/n)
    if %SHUTDOWN%==o GOTO SHUTDOWN
    if %SHUTDOWN%==O GOTO SHUTDOWN
    if %SHUTDOWN%==n GOTO MENU
    if %SHUTDOWN%==N GOTO MENU
    ECHO -------------------------------------------------------------------------------
    
    :SHUTDOWN
    shutdown -f -r -t 0
    ECHO Redemarage en cours...
    ECHO -------------------------------------------------------------------------------
    
    :LOGFLO
    ECHO -------------------------------------------------------------------------------
    ECHO 2 - Installation automatique logiciel Flo
    ECHO en cours... (0/21)
    start /wait ".\Logiciel\0Utilitaire\windows_movie_maker-setup.exe" /passive /noreboot
    ECHO en cours... (1/21)
    start /wait ".\Logiciel\0Utilitaire\7z-setupx64.msi" /passive /norestart /update
    ECHO en cours... (2/21)
    start /wait ".\Logiciel\0Utilitaire\virtual_clone_drive-setup.exe" /passive /noreboot
    ECHO en cours... (3/21)
    start /wait ".\Logiciel\0Utilitaire\supercopier-2.2beta-setup.exe" /passive /noreboot
    ECHO en cours... (4/21)
    start /wait ".\Logiciel\0Utilitaire\defraggler-setup.exe" /passive /noreboot
    ECHO en cours... (5/21)
    start /wait ".\Logiciel\0Utilitaire\glary_utilities-setup.exe" /passive /noreboot
    ECHO en cours... (6/21)
    start /wait ".\Logiciel\0Navigateur Internet\Chrome-Setup.exe" /passive /noreboot
    ECHO en cours... (7/21)
    start /wait ".\Logiciel\0Lecteur_Media\media_player_classic-setup.exe" /passive /noreboot
    ECHO en cours... (8/21)
    start /wait ".\Logiciel\0Programmation\notepad-setup.exe" /passive /noreboot
    ECHO en cours... (9/21)
    start /wait ".\Logiciel\0Traitement_Texte\openoffice-3.4.1-setup.exe" /passive /noreboot
    ECHO en cours... (10/21)
    start /wait ".\Logiciel\0Traitement_Texte\PDFcreator-1.4.3-setup.exe" /passive /noreboot
    ECHO en cours... (11/21)
    start /wait ".\Logiciel\0Traitement_Texte\PDFnuance-setup.exe" /passive /noreboot
    ECHO en cours... (12/21)
    start /wait ".\Logiciel\0Telechargement\java-setupx64.exe" /passive /noreboot
    ECHO en cours... (13/21)
    start /wait ".\Logiciel\0Telechargement\jdownloader-setup.exe" /passive /noreboot
    ECHO en cours... (14/21)
    start /wait ".\Logiciel\0Convertisseurs_Fichiers\daniusoft_dedia_converter_ultimate-setup.exe" /silent /noreboot
    ECHO en cours... (15/21)
    start /wait ".\Logiciel\0Convertisseurs_Fichiers\freemake_video_converter-setup.exe" /silent /noreboot
    ECHO en cours... (16/21)
    start /wait ".\Logiciel\0Programmation\wampserver-setupx64.exe" /passive /noreboot
    ECHO en cours... (17/21)
    start /wait ".\Logiciel\0Graphisme\blender-2.64a-setupx64.exe" /passive /noreboot
    ECHO en cours... (18/21)
    del "%SYSTEMDRIVE%\Windows\System32\drivers\etc\hosts" /F
    start /wait ".\Logiciel\0Graphisme\Photoshop CS5\Set-up.exe" /passive /noreboot
    start /wait ".\Logiciel\0Graphisme\Photoshop CS5\0_Extentsion.dds\Photoshop_Plugins_x64_8.54.0625.1800.exe" /passive /noreboot
    ECHO en cours... (19/21)
    start /wait ".\Logiciel\steam-setup.msi" /passive /norestart /update
    ECHO en cours... (20/21)
    start /wait ".\Logiciel\NOD32-setup.msi" /passive /norestart /update
    ECHO en cours... (21/21)
    XCOPY ".\Logiciel\00_Gadjets_Windows" "%USERPROFILE%\Desktop"
    ECHO Terminer
    ECHO -------------------------------------------------------------------------------
    PAUSE
    CLS
    GOTO MENU
    
    :CHARGER_MSI
    ECHO -------------------------------------------------------------------------------
    ECHO 8 - Chargement MSI en cours...
    DEL /S /Q ".\Sauvegarde\*" "Desktop.ini"
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Desktop" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Emploi" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Liens" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Ma musique" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Mes documents" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Mes images" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Mes videos" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Programmation" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Saves Games" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Cours" /S /I /Y
    XCOPY ".\Sauvegarde\MSI_FLO" "%USERPROFILE%\Telechargement" /S /I /Y
    ECHO Terminer
    ECHO -------------------------------------------------------------------------------
    PAUSE
    GOTO MENU
    
    :SAUVEGARDE_MSI
    ECHO -------------------------------------------------------------------------------
    ECHO 9 - Sauvegarde MSI en cours...
    
    SET /p nombre=<".\Sauvegarde\Compteur_Flo.txt"
    IF NOT EXIST ".\Sauvegarde\Compteur_Flo.txt" ECHO 1 > ".\Sauvegarde\Compteur_Flo.txt"
    ) ELSE (
    	SET /a nombre+=1
    	ECHO %nombre% > ".\Sauvegarde\Compteur_Flo.txt"
    	GOTO Boucle_Flo1
    )
    
    :Boucle_Flo1
    IF NOT EXIST ".\Sauvegarde\MSI_FLO%nombre%" GOTO Copy_Flo
    ) ELSE (
    	SET /a nombre+=1
    	ECHO %nombre% > ".\Sauvegarde\Compteur_Flo.txt"
    	GOTO Boucle_Flo2
    )
    :Copy_Flo
    	MD ".\Sauvegarde\MSI_FLO%nombre%"
    	XCOPY "%USERPROFILE%\Desktop" ".\Sauvegarde\MSI_FLO%nombre%\Desktop" /S /I /Y
    	XCOPY "%USERPROFILE%\Emploi" ".\Sauvegarde\MSI_FLO%nombre%\Emploi" /S /I /Y
    	XCOPY "%USERPROFILE%\Links" ".\Sauvegarde\MSI_FLO%nombre%\Links" /S /I /Y
    	XCOPY "%USERPROFILE%\Music" ".\Sauvegarde\MSI_FLO%nombre%\Music" /S /I /Y
    	XCOPY "%USERPROFILE%\Documents" ".\Sauvegarde\MSI_FLO%nombre%\Documents" /S /I /Y
    	XCOPY "%USERPROFILE%\Pictures" ".\Sauvegarde\MSI_FLO%nombre%\Pictures" /S /I /Y
    	XCOPY "%USERPROFILE%\Videos" ".\Sauvegarde\MSI_FLO%nombre%\Videos" /S /I /Y
    	XCOPY "%USERPROFILE%\Programmation" ".\Sauvegarde\MSI_FLO%nombre%\Programmation" /S /I /Y
    	XCOPY "%USERPROFILE%\Saved Games" ".\Sauvegarde\MSI_FLO%nombre%\Saved Games" /S /I /Y
    	XCOPY "%USERPROFILE%\Cours" ".\Sauvegarde\MSI_FLO%nombre%\Cours" /S /I /Y
    	XCOPY "%USERPROFILE%\Telechargement" ".\Sauvegarde\MSI_FLO%nombre%\Telechargement" /S /I /Y
    :Boucle_Flo2
    SET /p nombre=<".\Sauvegarde\Compteur_Flo.txt"
    IF /i %nombre% GEQ 3 do 
    	SET /A nombre=%nombre% - 3
    	RMDIR /Q ".\Sauvegarde\" "MSI_FLO%nombre%"
    	DEL ".\Sauvegarde\Fichier.txt" "Fichier.txt"
    	GOTO MENU
    )
    ECHO Terminer
    ECHO -------------------------------------------------------------------------------
    PAUSE
    GOTO MENU
    

    ----------------------------------------------------------------------------------------------------

    voilà pour le moment...
    je me demandais si c' est possible de cacher les fichiers qui sont en train d'etre copier...sans la commande CLS
    c'est possible ca ?
    0
    1. ken dumoulin Messages postés 60 Statut Membre 4
       
      Si ce sont des messages d'erreurs que tu veux ne pas faire apparaître tu peux les rediriger avec un tonscript.bat 2> error.log
      0
    2. Flo313Z
       
      merci pour l'info
      et c' est possible de rediriger les XCOPY dans un fichier du même genre ?
      j' ai regardé un peu pour faire un script pour une estimation de copie mais ce que j'ai vu me pique les yeux

      ' target='_blank' rel='nofollow'>http://www.batcher.fr/forum/viewtopic.php?t=189</code>
      

      des ~1,2 et des !X!
      c' est quoi la différence entre des !X! et des %X%
      et les %%a j' en et vu dans des boucle for

      BREF

      ma solution alternative serait de "effacer" OU "rediriger" affichage des XCOPY pour laisser que des :
      ECHO en cours...(1/10)
      XCOPY ".\Sauvegarde\MSI_FLO%nombre%" "%USERPROFILE%\Ma musique" /S /I /Y (invisible)
      ECHO en cours...(2/10)
      XCOPY ".\Sauvegarde\MSI_FLO%nombre%" "%USERPROFILE%\Mes documents" /S /I /Y (invisible)
      

      et si c' est pas possible je pense que ouvrir un 2eme cmd pour lancer la les XCOPY et de repasser dans le cmd principal pour les echo

      enfin je voudrais ton avis avant de me lancer la dedans
      merci d'avance
      0
    3. Flo313Z
       
      merci pour tout ken
      0