|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Delete files in useHello.
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. "sgr" <s**@discussions.microsoft.com> schrieb: Check out the "Remarks" section of 'MoveFileEx'' documentation:> 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". File Systems -- 'MoveFileEx' <URL:http://msdn.microsoft.com/library/en-us/fileio/fs/movefileex.asp> -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> 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 _ ) /// -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> 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. Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > 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 _ > ) > /// > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> >
ToolStrip Border
class for handling the key strike event Problem in .Net programming How difficult would this be? accessing FTP Server Manipulating data between data adapters Handling C++ DLL string pointer How to Query AD for Computer Names? Accessing data in code Listview - How to check ifi something is selected ? |
|||||||||||||||||||||||