how to delete a file when the windows start

  • Thread starter Thread starter paraidy
  • Start date Start date
P

paraidy

Hi, i'm new in this group and i need your help experts :) sometimes
some files are used by the system and is impossible to delete them, how
can i queue a file to delete it at next system startup before it is in
use? thx all.
 
paraidy said:
Hi, i'm new in this group and i need your help experts :)

You are welcome :-)!
sometimes some files are used by the system and is impossible to delete
them, how
can i queue a file to delete it at next system startup before it is in
use?

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 _
)
///
 
Thx man :) now i try it, can you tell me how it work? it make the file
in queue in a specific location in the registry or what procedure use
the system to queue the files and delete them at startup? thx again :)

Herfried K. Wagner [MVP] ha scritto:
 
in your Autoexec.BAT file put these lines
Cd\
cd \Filepath
attrib -r *.*
del *.*
echo Chr$(13)
 
Crash_beta said:
in your Autoexec.BAT file put these lines
Cd\
cd \Filepath
attrib -r *.*
del *.*
echo Chr$(13)

That'll work... if you're running win9x/WinME, but not Win2K and above.
 
Back
Top