|I'm using this batch file to take the newest file and copy it to another location. |
FOR /F %%I IN ('DIR *.* /B /O:-D') DO COPY %%I <<NewDir>> & EXIT
My exact syntax is this:
FOR /F %%I IN ('DIR H:\*.* /B /O:-D') DO COPY %%I F:\
But I'm getting an error saying the system cannot find the specified file. I had it working once about an hour ago, edited my live bat file to add this command and it stopped working. I don't know what I did as I accidentally closed the unsaved editor. Currently there are 3 files in H, I want the newest to go to F. Any help appreciated.