I am still not getting this to work correctly. How would you script deleting all files in the c:\windows\temp folder? My script will delete a couple of files and leave a lot more. One or two of the files can not be deleted however the others are free to delete. The problem is the Delete Function will delete one file at a time until it gets to that locked file and then the script will stop. I want it to continue after it reaches the locked file and finish deleting the rest of the files.