Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

copy last generated file using batch script in windows

Status
Not open for further replies.

pcinformace

Technical User
Nov 21, 2008
1
CZ
Hi people,

On windows 2003 server I have to set up and script which copy last generated file from particular direcory.what means I will get in an directory every 5 munutes an file get generated, so how to copy that last one generated to another location.

Surfing I found this

FOR /F %%I IN ('DIR *.* /B /O:-D ') DO COPY %%I <<NewDir>> & EXIT

but for some reason I cannot get it works.
Any suggestion is welcome.

Thank you in advance

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top