That "ATTRIB" thing you mention is probably the read-only flag. It's not a lock and you can overwrite a read-only file. In your case the file is opened by another program (lets say you opened a JPEG in Photoshop and can't delete the file from disk while it's opened in Photoshop) and the program itself locked the file not that attribute thing. You can't delete the file until the other program exits or closes the file. Use
Process Explorer to see which program opened a handle to it (on Vista/7 you need to run as administrator). You can also get the process list with some
Win32 modules I believe.