.BAT problème nombre de variables
Résolu
micromega
Messages postés
131
Date d'inscription
Statut
Membre
Dernière intervention
-
micromega Messages postés 131 Date d'inscription Statut Membre Dernière intervention -
micromega Messages postés 131 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je cherche à trouver la solution pour ce ".bat" qui ne veux pas fonctionner lorsque il y a trop de variable.
Dans l'exemple ci-dessous, si l'on se limite à R1 et R2, le ".bat" fonctionne, si l'on essayes d'aller plus loin : il bloque.
Quelqu'un aurait idée de la source du problème ?
set R1=C:\Program Files (x86)\NOM DU DOSSIER
set R2=C:\Program Files (x86)\DOSSIER\NOM DU DOSSIER
set R3=D:\NOM DU DOSSIER
set R4=D:\DOSSIER\NOM DU DOSSIER
set cherche=0
if exist "%R1%" (
rd /s /q "%R1%"
) else (
set cherche=1
)
if exist "%R2%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if exist "%R3%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if exist "%R4%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if %cherche% EQU 1 (
for %%i in (C,D) do (
if exist "%%i:\" set VrLetter=%%i& call :search %%i
)
goto FinBoucle
:search
for /r "%VrLetter%:\" %%j in (NOM DU DOSSIER) do (
if exist "%%j" RMDIR %%j /S /Q
)
goto :eof
)
)
)
rd /s /q "%ALLUSERSPROFILE%\Menu D'marrer\Programmes\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Menu D'marrer\Programmes\DOSSIER\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Start Menu\Programs\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Start Menu\Programs\DOSSIER\NOM DU DOSSIER" >NUL 2>&1
Merci de vos aides...>
Je cherche à trouver la solution pour ce ".bat" qui ne veux pas fonctionner lorsque il y a trop de variable.
Dans l'exemple ci-dessous, si l'on se limite à R1 et R2, le ".bat" fonctionne, si l'on essayes d'aller plus loin : il bloque.
Quelqu'un aurait idée de la source du problème ?
set R1=C:\Program Files (x86)\NOM DU DOSSIER
set R2=C:\Program Files (x86)\DOSSIER\NOM DU DOSSIER
set R3=D:\NOM DU DOSSIER
set R4=D:\DOSSIER\NOM DU DOSSIER
set cherche=0
if exist "%R1%" (
rd /s /q "%R1%"
) else (
set cherche=1
)
if exist "%R2%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if exist "%R3%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if exist "%R4%" (
rd /s /q "%R2%"
) else (
set cherche=1
)
if %cherche% EQU 1 (
for %%i in (C,D) do (
if exist "%%i:\" set VrLetter=%%i& call :search %%i
)
goto FinBoucle
:search
for /r "%VrLetter%:\" %%j in (NOM DU DOSSIER) do (
if exist "%%j" RMDIR %%j /S /Q
)
goto :eof
)
)
)
rd /s /q "%ALLUSERSPROFILE%\Menu D'marrer\Programmes\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Menu D'marrer\Programmes\DOSSIER\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Start Menu\Programs\NOM DU DOSSIER" >NUL 2>&1
rd /s /q "%ALLUSERSPROFILE%\Start Menu\Programs\DOSSIER\NOM DU DOSSIER" >NUL 2>&1
Merci de vos aides...>
A voir également:
- .BAT problème nombre de variables
- Fichier bat - Guide
- Nombre de jours entre deux dates excel - Guide
- Bat to exe converter - Télécharger - Édition & Programmation
- Nombre facile - Télécharger - Outils professionnels
- Ascii nombre de caractères - Guide