Everything is in the title, but more officially :
Why does Windows let me rename a running executable, but not delete it?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
It does not allow to delete the executable file and DLLs because Windows maps parts of the executable files into memory as part of the process creation, so it need the file during the lifetime of the process.
Unfortunately I have no true reason why it still allows to rename such files. I guess that this is done to enable the update of the dlls and exe files while they are running to minimize the service interruption time.
The linux (unix in general) in contrast allows to delete an executable file while it is running:
tmp]$ cp /usr/bin/md5sum .;ll md5*; \ (./md5sum /home/pub/iso/FC5/FC-5-i386-DVD.iso & ); \ rm md5sum ; ll md5*;ps -f -rwxr-xr-x 1 sergey sergey 37276 Oct 16 02:38 md5sum ls: cannot access md5*: No such file or directory UID PID PPID C STIME TTY TIME CMD sergey 2423 2422 0 02:32 pts/1 00:00:00 -bash sergey 2533 1 0 02:38 pts/1 00:00:00 ./md5sum /home/pub/iso/FC5/FC-5- sergey 2536 2423 0 02:38 pts/1 00:00:00 ps -f