1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| /// Creation dossier avec date d hier
@echo off
echo>_.vbs wscript.echo eval("date-1")
for /f "tokens=*" %%y in ('cscript/nologo _.vbs') do (set y=%%y)
echo HIER: %y%
SET y=%y:/=-%
ECHO %y%
mkdir C:\Users\Mag\Desktop\Application_16_03_2020\BtachWindows\records\%y%
del _.vbs 2>nul
////commande sql pour exporter les tableau base de donnée dans des fichiers CSV
sqlcmd -S .............-d ........ -E -Q "select * from ......... where day(date) = DAY(SYSDATETIME())-1 and CONVERT (time, date) >= '00:00:00.00' and CONVERT (time, date) <= '23:59:00.00' order by date asc;" -o "C:\Users\.......\Desktop\.............-\BtachWindows\records\%y%\........csv" -s"," -w 20000
sqlcmd -S .............--.............-\.............--d .............--E -Q "select * from .............-where day(date) = DAY(SYSDATETIME())-1 and CONVERT (time, date) >= '00:00:00.00' and CONVERT (time, date) <= '23:59:00.00' order by date asc;" -o "C:\Users\.............-\Desktop\.............-\BtachWindows\records\%y%\.............-.csv" -s"," -w 20000
//// Compression du dossier avec date hier
@echo off
start "" winrar a -afzip -ep1 -dh "C:\Users\.............-\Desktop\.............-\BtachWindows\%y%.zip" "C:\Users\.............-\Desktop\.............-\BtachWindows\records\%y%"
pause |
Partager