Delete a file occupied by Windows? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Delete a file occupied by Windows?

How is it possible 2 delete a file used by Windows 98? Does anyone knows how to perserve a file from deleting, so the error message should apear like as the file was used by windows? Lots of trojans and viruses use it, so they can't be deleted....Thanx in advane!


Comments

  • Only way I can think of off the top of my head is to set the +s or +r flags (system file/read only). I'll go back and see how I did it with my temporary files though. If what I stated here doesn't work, let me know.



    -Seph




  • No man... That's not it...

    They can also be deleted.

    That's the thing with those trojans/viruses they have ordinary attributes.


  • OK, only other way I can think of would be to have it open for access, even if you don't ever write or read from it. If you try deleting a file that is opened, it usually says something along the lines of "File is in use by Windows..." and won't delete it. Hope that helps.



    -Seph


  • Hi. If the application is being used by Windows, then you can either post the message 'PostMessage(hwnd, WM_CLOSE, 0, 0)' to Windows or delete the application through DOS.

    Hope that helps :-)




Sign In or Register to comment.