filedelete , "File could not be deleted"

Started by pzig98, October 16, 2014, 08:10:22 AM

Previous topic - Next topic

pzig98

1590: FileDelete: File could not be deleted


My script fails on the the filedelete command.   File attribute is -A--

directory in Win7 is read only using right click>properties  as all directorys seem to be.

But DirAttrGet shows -A-- too...

Any help?

td

Not being able to delete a file is usually but not always caused by your account not having 'modify' or 'full control' permission on the file (not to be confused with file attributes) or the file is locked by another process on the system.  The former requires that you change the file permissions before you attempt to delete it and the second requires that you kill the process that is locking the file. 

You can use the Network extender to programmatically change permissions and you can use MSFT's Process Explorer to determine which, if any, process is locking the file.  You can also simply use Windows Explorer's file context menu Properties item to check and change permissions assuming your user account has sufficient privileges.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade