I have made a file upload system. When employees use it, the system will prompt them to first enter their employee number and then click "Submit". (At this time, a folder named after the employee's work number will be generated in a directory called "scan" on my server A.) Then the employee can enter the next interface to select some files on the local computer and then click "Upload".
I will run a batch script on my server A. It will first check if there are folders in the "scan" directory. If there are, it will copy this folder and the files inside it to a file server B accessible to all employees, and then the batch script will immediately delete the folder in the "scan" directory. (That is, to achieve the purpose of cutting.)
Now the problem is that when the batch script on server A is performing the copy + delete operation, an employee is preparing to upload a file. The folder named after his employee number has been generated in "scan", but he hasn't started uploading the file yet! At this time, the deletion action on server A has also deleted this empty folder, so he fails when uploading the file.
So my batch script should be modified. I hope to only delete the non-empty folders in the "D:\scan\" directory.
Please help me figure out a way. Thanks a lot!
I will run a batch script on my server A. It will first check if there are folders in the "scan" directory. If there are, it will copy this folder and the files inside it to a file server B accessible to all employees, and then the batch script will immediately delete the folder in the "scan" directory. (That is, to achieve the purpose of cutting.)
Now the problem is that when the batch script on server A is performing the copy + delete operation, an employee is preparing to upload a file. The folder named after his employee number has been generated in "scan", but he hasn't started uploading the file yet! At this time, the deletion action on server A has also deleted this empty folder, so he fails when uploading the file.
So my batch script should be modified. I hope to only delete the non-empty folders in the "D:\scan\" directory.
Please help me figure out a way. Thanks a lot!
