Amigos este bat cumple ala funcion de llamar un archivo del dia aterior y copiarlo, pero como pasamos al siguien mes no corre, necesito que llame al dia anterior Del mes anterior. ayuda.
@ECHO actualiza las bbdd.....
DEL C:\Users\gfigueroa\Desktop\Informe_NUEVO_MODELO\Multisector\SAC\BBDD\Resultante_SAC_JUMBO_RECORRIDOS_DIARIA.xls
IF NOT "%OS%"=="Windows_NT" GOTO Syntax
IF NOT [%1]==[] GOTO Syntax
@ECHO OFF
SETLOCAL
@ECHO OFF
START /W REGEDIT /E %TEMP%.\_TEMP.REG "HKEY_CURRENT_USER\Control Panel\International"
@ECHO OFF
FOR /F "tokens=1* delims==" %%A IN ('TYPE %TEMP%.\_TEMP.REG ^| FIND /I "iDate"') DO SET iDate=%%B
FOR /F "tokens=1* delims==" %%A IN ('TYPE %TEMP%.\_TEMP.REG ^| FIND /I "sDate"') DO SET sDate=%%B
DEL %TEMP%.\_TEMP.REG
@ECHO OFF
SET iDate=%iDate:"=%
SET sDate=%sDate:"=%
@ECHO OFF
IF %iDate%==0 FOR /F "TOKENS=1-4* DELIMS=%sDate%" %%A IN ('DATE/T') DO (
SET LocalFormat=MM%sDate%DD%sDate%YYYY
SET YesterLocal=%%YesterM%%%sDate%%%YesterD%%%sDate%%%YesterY%%
SET Year=%%C
SET Month=%%A
SET Day=%%B
)
IF %iDate%==1 FOR /F "TOKENS=1-4* DELIMS=%sDate%" %%A IN ('DATE/T') DO (
SET LocalFormat=DD%sDate%MM%sDate%YYYY
SET YesterLocal=%%YesterD%%%sDate%%%YesterM%%%sDate%%%YesterY%%
SET Year=%%C
SET Month=%%B
SET Day=%%A
)
IF %iDate%==2 FOR /F "TOKENS=1-4* DELIMS=%sDate%" %%A IN ('DATE/T') DO (
SET LocalFormat=YYYY%sDate%MM%sDate%DD
SET YesterLocal=%%YesterY%%%sDate%%%YesterM%%%sDate%%%YesterD%%
SET Year=%%A
SET Month=%%B
SET Day=%%C
)
@ECHO OFF
FOR %%A IN (%Year%) DO SET Year=%%A
FOR %%A IN (%Month%) DO SET Month=%%A
FOR %%A IN (%Day%) DO SET Day=%%A
@ECHO OFF
SET SortDate=%Year%%Month%%Day%
@ECHO OFF
FOR %%A IN (%Date%) DO SET Today=%%A
@ECHO OFF
SET DayS=%Day%
IF %Day:~0,1%==0 SET DayS=%Day:~1%
@ECHO OFF
IF %DayS% EQU 1 (
SET YesterY=%Year%
CALL :RollMonth
) ELSE (
SET /A YesterD=%DayS% - 1
SET YesterM=%Month%
SET YesterY=%Year%
)
@ECHO OFF
IF %YesterD% LSS 10 SET YesterD=0%YesterD%
@ECHO OFF
set FECHA= %date%
@ECHO OFF
set DIA=%DATE:~,2%
set MES=%DATE:~3,2%
set AÑO=%DATE:~6%
SET YesterD=%YesterD%
@ECHo ON
copy C:\Users\gfigueroa\Desktop\Informe_NUEVO_MODELO\Multisector\SAC\BBDD\JUMBO\Resultante_SAC_JUMBO_RECORRIDOS_DIARIA_%YesterY%%YesterM%%YesterD%.xls C:\Users\gfigueroa\Desktop\Informe_NUEVO_MODELO\Multisector\SAC\BBDD\Resultante_SAC_JUMBO_RECORRIDOS_DIARIA.xls
exit
Gracias