Skip to main content
deleted 91 characters in body; edited tags
Source Link
Canadian Luke
  • 24.4k
  • 39
  • 119
  • 175

I am trying to build a .bat file to move files from 1 folder into another5another one, based off of the oldest timestampedtime-stamped file.


 

folder 1 contentsFolder 1:

filename: Date Modified: test1.dat 5/12/2014 4:03pm test2.dat 5/12/2014 4:04pm

Filename:        Date Modified:
test1.dat        5/12/2014 4:03pm
test2.dat        5/12/2014 4:04pm

The goal is to move the oldest file to:

folder 2


into Folder 2. Currently, my batch file below movemoves everything from folder 1 to folder 2, obviously because I don't have any time related code entered.


set Delay=10

move /-y "C:\Users\bingersoll001\Desktop\folder1*.dat" "C:\Users\bingersoll001\Desktop\folder2"

timeout 10 /nobreak

call move.bat


set Delay=10
move /-y "C:\Users\bingersoll001\Desktop\folder1\*.dat" "C:\Users\bingersoll001\Desktop\folder2"
timeout 10 /nobreak
call move.bat

Is there any way to accomplish this?

I am trying to build a .bat file to move files from 1 folder into another5 one based off the oldest timestamped file.


 

folder 1 contents:

filename: Date Modified: test1.dat 5/12/2014 4:03pm test2.dat 5/12/2014 4:04pm

move oldest file to:

folder 2


Currently, my batch file below move everything from folder 1 to folder 2, obviously because I don't have any time related code entered.


set Delay=10

move /-y "C:\Users\bingersoll001\Desktop\folder1*.dat" "C:\Users\bingersoll001\Desktop\folder2"

timeout 10 /nobreak

call move.bat


Is there any way to accomplish this?

I am trying to build a .bat file to move files from 1 folder into another one, based off of the oldest time-stamped file.

Folder 1:

Filename:        Date Modified:
test1.dat        5/12/2014 4:03pm
test2.dat        5/12/2014 4:04pm

The goal is to move the oldest file into Folder 2. Currently, my batch file below moves everything from folder 1 to folder 2, obviously because I don't have any time related code entered.

set Delay=10
move /-y "C:\Users\bingersoll001\Desktop\folder1\*.dat" "C:\Users\bingersoll001\Desktop\folder2"
timeout 10 /nobreak
call move.bat

Is there any way to accomplish this?

Source Link
Brian
  • 11
  • 1
  • 2

Move 1 file at a time based off timestamp using windows batch utility

I am trying to build a .bat file to move files from 1 folder into another5 one based off the oldest timestamped file.


folder 1 contents:

filename: Date Modified: test1.dat 5/12/2014 4:03pm test2.dat 5/12/2014 4:04pm

move oldest file to:

folder 2


Currently, my batch file below move everything from folder 1 to folder 2, obviously because I don't have any time related code entered.


set Delay=10

move /-y "C:\Users\bingersoll001\Desktop\folder1*.dat" "C:\Users\bingersoll001\Desktop\folder2"

timeout 10 /nobreak

call move.bat


Is there any way to accomplish this?