[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

Batch file to copy paste

I need a batch file which will copy files which the modified date is not the current date from a folder A and paste it in folder B.

And

to delete files from folder B which is older than five days (from top)

And i need to schedule it in windows scheduler to run this at 15:00 . If the today's file not arrived at 15:00 it should run at 16:00 and again its not arrived 17:00 and so on ...till 23:00...

Please help me !
0
jaisonshereen
Asked:
jaisonshereen
  • 3
  • 2
1 Solution
 
kram0Commented:
"xcopy <source> <destination> /D /Y" will work to copy/overwrite files that are newer than what already exists in the destination.
As for deletion of older files, you may need to run something from vbs.
0
 
jaisonshereenAuthor Commented:
how to delete the file according to "modified date"?
0
 
kram0Commented:
This VBS looks to be pretty much exactly what you are after...
http://cwashington.netreach.net/depo/view.asp?Index=723
0
 
jaisonshereenAuthor Commented:
could you tell me how to execute this?

i have copy pasted the entire script as filename.vbs

is it a mater of double clicking?
0
 
kram0Commented:
Double-click will work. You could call it from the batch file with "wscript filename.vbs".
You could then schedule the batch file to run automatically.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now