Using Date command to copy files everyday by Date()-4

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
sajjansinghania
Posts: 15
Joined: 23 Apr 2017 22:36

Using Date command to copy files everyday by Date()-4

#1 Post by sajjansinghania » 24 Apr 2019 11:38

I have Windows 8.1. I have about 20 computers. I have to edit date option everyday to XCopy files. I need DOS Command by which I can XCopy files for 4 days older to Date().
Help is required
Thanks

Code: Select all

@Echo Off
@Cls
*** Substituting target drives
@Net Use /Persistent:No
@Net Use Y: \\Sup\SupF
@Net Use Z: \\Pcs\PcsD
*** Deleting old already used files by working folders
@Del /A /Q  Z:\SysFold\CbosImps\*.*
@Del /A /Q  Z:\SysFold\ComImps\*.*
*** Downloading source data files by FTP client
@"C:\Program Files\LeechFtp\LeechFtp"
*** Unzipping Gz and Zip files in downloaded folders
@If Exist Y:\Accounts\1819\Download\11205\Accounts\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\11205\Accounts\*.Gz
@If Exist Y:\Accounts\1819\Download\11205\Clearing\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\11205\Clearing\*.Gz
@If Exist Y:\Accounts\1819\Download\11205\Reports\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\11205\Reports\*.Gz
@If Exist Y:\Accounts\1819\Download\11205\Trades\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\11205\Trades\*.Gz
@If Exist Y:\Accounts\1819\Download\11205\InterAct\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\11205\InterAct\*.Gz
@If Exist Y:\Accounts\1819\Download\11205\Bhavcopy\*.Zip C:\Zip\WzUnZip -E Y:\Accounts\1819\Download\11205\Bhavcopy\*.Zip Pd*.Csv Y:\Accounts\1819\Download\11205\Bhavcopy\
@If Exist Y:\Accounts\1819\Download\11205\Trades\*.Zip C:\Zip\WzUnZip -N -O Y:\Accounts\1819\Download\11205\Trades\*.Zip Y:\Accounts\1819\Download\11205\Trades\
@If Exist Y:\Accounts\1819\Download\F11205\Cn01\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\F11205\Cn01\*.Gz
@If Exist Y:\Accounts\1819\Download\F11205\Reports\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\F11205\Reports\*.Gz
@If Exist Y:\Accounts\1819\Download\F11205\Trades\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\F11205\Trades\*.Gz
@If Exist Y:\Accounts\1819\Download\F11205\InterAct\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\F11205\InterAct\*.Gz
@If Exist Y:\Accounts\1819\Download\F11205\Trades\*.Zip C:\Zip\WzUnZip -N -O Y:\Accounts\1819\Download\F11205\Trades\*.Zip Y:\Accounts\1819\Download\F11205\Trades\
@If Exist Y:\Accounts\1819\Download\X11205\InterAct\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\X11205\InterAct\*.Gz
@If Exist Y:\Accounts\1819\Download\X11205\Trades\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\X11205\Trades\*.Gz
@If Exist Y:\Accounts\1819\Download\X11205\Reports\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\X11205\Reports\*.Gz
@If Exist Y:\Accounts\1819\Download\X11205\Bhavcopy\*.Gz C:\Zip\GZip -D -F -Y-N Y:\Accounts\1819\Download\X11205\Bhavcopy\*.Gz
@If Exist Y:\Accounts\SoftWare\Nse\*.Gz C:\Zip\GZip -D -F -Y -N Y:\Accounts\SoftWare\Nse\*.Gz
@If Exist Y:\Accounts\SoftWare\NcdEx\*.Zip C:\Zip\WzUnZip -N -O Y:\Accounts\SoftWare\NcdEx\*.Zip Y:\Accounts\SoftWare\NcdEx\
@If Exist Y:\Accounts\SoftWare\Nse-Cds\*.Gz C:\Zip\GZip -D -F -Y -N Y:\Accounts\SoftWare\Nse-Cds\*.Gz
*** Copying data files from downloaded folders to working folders
@If Exist Y:\Accounts\1920\Download\X11205\Reports\X_Mg*.* XCopy Y:\Accounts\1920\Download\X11205\Reports\X_Mg*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\X11205\Bhavcopy\*.* XCopy Y:\Accounts\1920\Download\X11205\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\X11205\Reports\X_Ps*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\X11205\Reports\X_Ps*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\X11205\Trades\X_Tr*.* XCopy Y:\Accounts\1920\Download\X11205\Trades\X_Tr*.* /D:02-24-2019 Z:\SysFold\CbosImps\ *.*
@If Exist Y:\Accounts\1920\Download\X11205\Trades\Cdt*.* XCopy Y:\Accounts\1920\Download\X11205\Trades\Cdt*.* /D:02-24-2019 Z:\SysFold\CbosImps\*,*
@If Exist Y:\Accounts\1920\Download\X11205\Trades\X_Tr*.* XCopy Y:\Accounts\1920\Download\X11205\Trades\X_Tr*.* /D:02-24-2019 Z:\SysFold\CbosImps\ *.*
@If Exist Y:\Accounts\1920\Download\X11205\Trades\Cdt*.* XCopy Y:\Accounts\1920\Download\X11205\Trades\Cdt*.* /D:02-24-2019 Z:\SysFold\CbosImps\*,*
@If Exist Y:\Accounts\1920\Download\X11205\Reports\X_Mg*.* XCopy Y:\Accounts\1920\Download\X11205\Reports\X_Mg*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\X11205\Bhavcopy\*.* XCopy Y:\Accounts\1920\Download\X11205\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\X11205\Reports\X_Ps*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\X11205\Reports\X_Ps*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\Use\Trades\*.* XCopy Y:\Accounts\1920\Download\Use\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\Use\Bhavcopy\*.* XCopy Y:\Accounts\1920\Download\Use\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\1920\Download\Use\Reports\*.* XCopy Y:\Accounts\1920\Download\Use\Reports\*.* /D:02-24-2019 Z:\SysFold\CbosImps\*.*
@If Exist Y:\Accounts\Auction\A*.Txt XCopy Y:\Accounts\Auction\A*.Txt Y:\Accounts\Auction\Nse.Auc* /D /F /I /V /Y
@If Exist Y:\Accounts\1920\Download\50\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\50\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\50\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\50\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\50\Reports\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\50\Reports\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\11205\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\11205\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\BSE\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\BSE\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\BFX\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\BFX\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\BFX\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\BFX\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\Now\Nse-Cds\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Now\Nse-Cds\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\Now\Nse-NFO\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Now\Nse-NFO\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\F11205\Reports\F_Mg*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F11205\Reports\F_Mg*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\F11205\Reports\F_PS*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F11205\Reports\F_PS*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\F11205\Now\Admin\Trade\Trade*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F11205\Now\Admin\Trade\Trade*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\ODIN\Nse-Cm\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\ODIN\Nse-Cm\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\ODIN\Nse-Fo\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\ODIN\Nse-Fo\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\ODIN\Mcx\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\ODIN\Mcx\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\F11205\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F11205\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\F11205\CN01\*.* /D:02-24-2019XCopy Y:\Accounts\1920\Download\F11205\CN01\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\MFO\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\MFO\Trades\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\MFO\Reports\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\MFO\Reports\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\MFO\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\MFO\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\CbosImps\
@If Exist Y:\Accounts\1920\Download\16795\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\16795\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\16795\Reports\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\16795\Reports\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\16795\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\16795\Trades\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\Cl0132\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Cl0132\Trades\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\Cl0132\Reports\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Cl0132\Reports\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\Cl0132\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Cl0132\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\Cl0132\Reports\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\Cl0132\Reports\*.* /D:02-24-2019 Z:\SysFold\ComImps\v
@If Exist Y:\Accounts\1920\Download\F00146\CN01\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F00146\CN01\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\F00146\Reports\NcdEx_Tr*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F00146\Reports\NcdEx_Tr*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\F00146\Reports\NcdEx_Mg*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\F00146\Reports\NcdEx_Mg*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\ODIN\NcdEx\Trades\NcdExt*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\ODIN\NcdEx\Trades\NcdExt*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\ODIN\Mcx\Trades\McxT*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\ODIN\Mcx\Trades\McxT*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\14040\Trades\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\14040\Trades\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\14040\Bhavcopy\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\14040\Bhavcopy\*.* /D:02-24-2019 Z:\SysFold\ComImps\
@If Exist Y:\Accounts\1920\Download\14040\ProductMaster\*.* /D:02-24-2019 XCopy Y:\Accounts\1920\Download\14040\ProductMaster\*.* /D:02-24-2019 Z:\SysFold\ComImps\

Post Reply