Please see the comments to the question by Zoltán Zörgő and mine. You did not provide relevant information on what happens. One of the most apparent thing which might happen is this: some executable files in this directory are loaded for execution and are actually executed when you try to execute your code. Also, some data files could be opened by some processes for exclusive access (which is done by default) and not closed. In both cases, it is not possible to delete such files; you would need to kill the processes which hold them.
You can you investigate which process holds which file. For this, I recommend using one utility from the
Sysinternals Suite. This set of utilities (formerly from
Winternals company, presently at Microsoft) is a must-have for any developer, please see:
http://technet.microsoft.com/en-us/sysinternals/bb842062[
^],
http://technet.microsoft.com/en-us/sysinternals/bb545027[
^].
The utility you need is "
handle.exe", please see:
http://technet.microsoft.com/en-us/sysinternals/bb896655[
^].
This utility will scan all kinds of handles, not just file handles. For file, it will scan all file handles matching the file name (so it does not have to be a full path name) and return information sufficient to identify each process, including its
pid. So, if you need more information on a process in question, you can also use other Sysinternals utilities, in particular, its
Process Explorer:
http://technet.microsoft.com/en-us/sysinternals/bb896653[
^].
Note that these considerations are very basic. They along cannot help you to fight really sly viruses, most of which are way more cryptic and hard to remove.
Good luck,
—SA