Delete files in use

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I'm trying to do a program that delete some files and registry entries, Is
there any way to delete the files that "are in use".

Thanks in advance.
 
Addendum:

How To Move Files That Are Currently in Use
<URL:http://support.microsoft.com/?scid=kb;EN-US;140570>

\\\
Private Declare Auto Function MoveFileEx Lib "kernel32.dll" ( _
ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal dwFlags As Int32 _
) As Boolean

Private Const MOVEFILE_DELAY_UNTIL_REBOOT As Int32 = &H4
....
Dim Success As Boolean = _
MoveFileEx( _
<file name>, _
vbNullString, _
MOVEFILE_DELAY_UNTIL_REBOOT _
)
///
 
Thanks for all.

It runs ok, but I need a way to remove a registry entry and i haven`t
permissions in the key.
I 'm administrator of the computer. Is there any way in VB .NET to change
the permissions?

Thanks for all.
 
Back
Top