DOS CMD Help
I have a .bat file which contains the following command
copy /y "d:\downtime\report.htm" "\\server55\downtime\folder2"
The htm file is recreated every 10 minutes but occasionally the htm file is corrupted and has a filesize of 0, if this occurs i would like to prevent it being copied. Can anyone suggest how i might write something into the batch file to only copy the file of filesize is greater than 0 ?
Any advice appreciated
Cheers
Andy
copy /y "d:\downtime\report.htm" "\\server55\downtime\folder2"
The htm file is recreated every 10 minutes but occasionally the htm file is corrupted and has a filesize of 0, if this occurs i would like to prevent it being copied. Can anyone suggest how i might write something into the batch file to only copy the file of filesize is greater than 0 ?
Any advice appreciated
Cheers
Andy
Something like:
FORFILES /P d:\downtime /M report.txt /C "cmd /c if @fsize GEQ 0 copy /y @file \\server55\downtime\folder2"
An extra exit would be needed to end the extra CMD session.
But that's off the top of my head, test it thoroughly!!
FORFILES /P d:\downtime /M report.txt /C "cmd /c if @fsize GEQ 0 copy /y @file \\server55\downtime\folder2"
An extra exit would be needed to end the extra CMD session.
But that's off the top of my head, test it thoroughly!!


Thanks to you LostUser also.. that may come in useful too.
Thread
Thread Starter
Forum
Replies
Last Post



