Well, I discovered why Windows takes the exact five seconds.
I launched Process Monitor and filtered lines with the name of a test file I would try to delete (winplot.exe
- sorry scientists). After the test, the log showed me that Windows XP tried to delete the file six times, with one second between each trial. You can see it clearly in the first column below:
18:02:37,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:37,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:37,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:37,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:37,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:38,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:38,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:38,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:39,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:39,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:39,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:40,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:40,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:40,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:41,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:41,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:41,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:42,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:42,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE CreateFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryAttributeTagFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS Attributes: N, ReparseTag: 0x0
18:02:42,59 Explorer.EXE SetDispositionInformationFile D:\Documents and Settings\aneves\Desktop\winplot.exe CANNOT DELETE Delete: True
18:02:42,59 Explorer.EXE CloseFile D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
18:02:42,59 Explorer.EXE QueryOpen D:\Documents and Settings\aneves\Desktop\winplot.exe SUCCESS
I don't know what to make of this programming choice, except that it appears rather dumb to me at first sight -- sorry, Microsoft, I'm being really honest here.
*
EDIT: to be rigorous, it tries to delete seven times, but the last time immediately follows the former