S'il EXISTE C:\directory\ goto un else goto b problèmes de windows XP fichiers batch

chaque fois que je lance le code ci-dessous, il se produit pour moi, j'ai fait une erreur à l'aide de la s'il existe des lignes, comme peu importe si le répertoire existe ou pas, il agit comme si la ligne n'a jamais été là... ça ou pas la lecture de la ligne else.


echo off  
echo  
echo (c) Ryan Leach 2010  
echo Stockmaster Backup System for exclusive use of Riverland Paper Supplies  
echo  
echo Please ensure that all computers are out of stock master to the windows xp screen  
echo and that the backup usb with the day of the week labeled on it is inserted  

pause  

IF EXIST D:\RPS_BACKUP\backups_to_zip\ goto zipexist else goto zipexistcontinue  
:zipexist  
IF EXIST d:\RPS_BACKUP\backups_old\ rd /s /q D:\RPS_BACKUP\backups_old  
echo backup did not complete last time, backup will restart from zip-usb phase.  
pause  
call zip  
goto tidyup  
:zipexistcontinue  

IF EXIST D:\RPS_BACKUP\backups_old\ goto oldexists else oldexistscontinue  
:oldexists  
IF EXIST d:\RPS_BACKUP\backup_temp\ rename D:\RPS_BACKUP\backups_temp backups_to_zip  
rd /s /q D:\RPS_BACKUP\backups_old  
echo backup did not complete last time, backup will restart at the zip to usb phase.  
pause  
call zip  
goto tidyup  
:oldexistscontinue  

IF EXIST D:\RPS_BACKUP\backups_temp\ goto tempexists else goto tempexistscontinue  
:tempexists  
IF EXIST D:\RPS_BACKUP\backups_old\ goto backupfailed else goto tempexistscontinue  
:backupfailed  
@rd /s /q D:\RPS_BACKUP\backups_temp  
echo backup did not complete last time, backup will restart from start.  
pause  
:tempexistscontinue  

md D:\RPS_BACKUPS\backups_temp  
xcopy \\user1\c\* D:\RPS_BACKUP\backups_temp\user1\c /h /e /z /f /r /i /s /k  
IF NOT ERRORLEVEL == 1 GOTO ErrorHandler  
xcopy C:\* D:\RPS_BACKUP\backups_temp\user2\c /h /e /f /r /i /s /k  
IF NOT ERRORLEVEL == 1 GOTO ErrorHandler  
xcopy \\user3\c\* D:\RPS_BACKUP\backups_temp\user3\c /h /e /z /f /r /i /s /k  
IF NOT ERRORLEVEL == 1 GOTO ErrorHandler  
call sub  
call zip  
:tidyup  
rename D:\RPS_BACKUP\backups_to_zip backups  
pause  
goto :eof  

:ErrorHandler  
echo xcopyerrorcode is ERRORLEVEL contact ryan  
pause  
  • Vérifié les autorisations sur les répertoires?
  • les autorisations sont belles, comme les répertoires n'existent pas. Je ne suis pas inquiet au sujet de la copie réseau encore.
  • dans le deuxième groupe, il vous manque le GOTO directive. goto oldexists else oldexistscontinue
  • merci, remarqué moi-même par la suite lorsque je met sur toutes les lignes suivantes.