Copy Files by Renaming after Checking if it Exists and is...
Posted: 21 Jun 2012 13:46
Batch Scripting:
I have few files in source location to be copied to destination location by renaming them. But before that I have to check if the file exists or is empty(no data in file) in the source location. If it does not exist or is empty in the source then do nothing.
Else copy from source to the destination by renaming it.
Example would be like
Source has files:
File(1).dat
File(2).dat
File(3).dat
Destination should have:
Rev(1).dat
Rev(2).dat
Rev(3).dat
assuming all files are non-empty. Thank you!!
I have few files in source location to be copied to destination location by renaming them. But before that I have to check if the file exists or is empty(no data in file) in the source location. If it does not exist or is empty in the source then do nothing.
Else copy from source to the destination by renaming it.
Example would be like
Source has files:
File(1).dat
File(2).dat
File(3).dat
Destination should have:
Rev(1).dat
Rev(2).dat
Rev(3).dat
assuming all files are non-empty. Thank you!!