Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

Create a Batch file - Please help ! Expand / Collapse
Posted Monday, November 4, 2013 11:41 AM


Group: General Forum Members
Last Login: Wednesday, February 10, 2016 11:52 AM
Points: 142, Visits: 633
Hello there !

Please help me to create a batch file which does/satisfy the below requirement..,

I want to Copy older than 30 Days Files to archive Folder in all Sub folders of Backup Folder
like I have a backup folder name : D:\Main Folder
In D:\Main Folder I have a multiple Sub directories like
D:\Main Folder\a_folder
D:\Main Folder\b_folder
D:\Main Folder\c_folder
D:\Main Folder\d_folder
In each sub folder I have multiple Files like for Example more than 100 Files Excel ...

Daily some FTP Server pushes the Files in to different sub Folders in Main Folder - which I don't have control on that FTP process.

SO what I trying to achieve using batch file is

I want to copy older than 30 days Files in D:\Main Folder\a_folder to same D:\Main Folder\Archive a_folder if Archive a_folder is not exists we need to create the folder and copy the files and do same with D:\Main Folder\b_folder to D:\Main Folder\Archive b_folder & D:\Main Folder\c_folder to D:\Main Folder\Archive C_folder .........,

**Condition - We don't know the Sub Folder names or File Names

Please I was working on this from last week - using some example - but no luck
If you guys have any related Script like not the extract match - please share

Post #1511227
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse