File Deletion Automated in Windows

46 views Asked by At

We have following requirement.can anyone please help me to write bat script? if you have the script already for my requirement it would be very much appriciated.

1.Input text file will be uploaded manually in the server path e.g: E:\usr\sap\python\input.txt

2.SAP job will create output.txt in the same server path e.g: E:\usr\sap\python\output.txt

3.Once the ouput.txt is generated, that should be copied to archive folder e.g: E:\usr\sap\archive\ouput.txt

4.Once it is moved to archive folder with time stamp, the script should delete all the files in the path E:\usr\sap\python

1

There are 1 answers

3
morantis On

How about this. Rather than give you the direct programming, let me guide you with a basic flow. A very simple script can do this....

  1. Check if the file exists in the output folder.....

    a. If it exists....delete the file you want b. If it is not there.....restart the script

This is better done with something like Visual Basic and may not be entirely possible with a batch script.