1.

Solve : Dos script?

Answer»

Each time one of our processes runs it creates a file where the filename includes a unique identifier. The name looks like xxxx_99999.pdf, where the xxxx part stays the same, but the 99999 part varies. We can't know what it will be although they are sequential. We want to create a DOS script to COPY the most recently created file in a folder to ANOTHER location. Any solutions?Whatever methodology the process that creates the files uses, needs to be used in your script to generate that same file name.

Without you telling us your OS, anything else would be just a guess.

Let us know. I guess I should have made clear that I'm dealing with MS-DOS. We can't change the proprietary process creating the file.MS-DOS really doesn't give you a lot of options. One possibilty would be to get a DIR list reverse sorted by create date and then processing the one on top.

Code: [Select]
for /f %%a in ('dir /tc /o:-d /s /B *.pdf') do goto process

:process


When you get to the process label, %%a will contain your latest pdf file which you can then process. Not the best WAY, but it just may work or it may give you some ideas.

Hope this helps. This sounds like a good way to start. Thanks a lot.WE HAVE A SOLUTION. Thanks.



Discussion

No Comment Found