| 1. |
Solve : determine file status..? |
|
Answer» Hello Everyone so my batch file is failing after executing few steps How is it failing? If you are getting a message on the console, you can process that message and take directed action. Need more specific information. Its reading the file name and the file exists but the file copy is in progress. but my next line of the code says.. if file exists.. .started reading the data from file.. but as the file is not copied completely.. its failing when it is trying to read data from the file. The whole problem occurs only when batch file gets executed when the file copy is to the destination folder is in progress how should I find out that file copy is completed or not is there any way to findout ? Quote Its reading the file name and the file exists but the file copy is in progress. What program are you USING to read from the file? I'm surprised the OS would allow opening a file that is opened for output by another process. Perhaps you could take action based on an error code produced by your program. I am writing in the batch file and using the batch file in SSIS package Quote my Problem is .. I have a batch file which is running for every 15min and every time checks if the specified file exists in the given path or not .. Are you referring to SQL Server Integration Services? Is this on a network? Part of the problem may be that the copy is OVERWRITING the previous version. The NTFS index may reflect the attributes of the old file which might explain why the file exist test gives a false POSITIVE result. Any chance you could move the copy to the SSIS batch file? You could then check if the copy was successful and run SSIS. The Windows copy command runs INSIDE the command shell. Only under certain conditions would you be able to see if the copy command was in progress and even then it would not be with batch language. You might also have the script that does the copy set an parameter in a file as to whether a copy operation was in progress or not. You SSIS batch file could query this parameter to determine if SSIS runs. Good luck |
|