I want to make a script that only copies a file once if it exists. There is no copying or creating but if or if in .bat (Batch) the file is called:
TestBackUp.rar
is in the hard drive at the following URL
C:\BackUP\TestBackUp.rar
I wish to copy it if the following URL does NOT exist
D:\BackUP\TestBackUp.rar
The code in SQL would be something like for example:
IF NOT EXISTS (SELECT TestBackUp.rar)
COPY
ELSE
NO COPY
This is a small piece of what I have in advance:
@echo off
:: aqui condicion IF no existe dentro del directorio D:\BackUP\TestBackUp.rar
echo Buscando y comprimiendo desde WinRaR en 32 y 64 Bits
"C:\Program Files\WinRAR\WinRAR.exe" A -R D:\BackUp\TestBackUp.RAR "C:\BackUp\Patch"
cls
echo Buscando y comprimiendo desde WinRaR en 32
"C:\Program Files (x86)\WinRAR\WinRAR.exe" A -R D:\BackUp\TestBackUp.RAR "C:\BackUp\Patch"
::Fin de condicion
cls
rd /s /q "C:\BackUp"
move C:\Temporal\BackUp\*.RAR D:\BackUp
cls
rd /s /q "C:\Temporal"
echo.
::de lo contrario
cls
rd /s /q "C:\BackUp"
move C:\Temporal\BackUp\*.RAR D:\BackUp
cls
rd /s /q "C:\Temporal"
echo.
Exit