how to delete a file when the windows start

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.
 
H

Herfried K. Wagner [MVP]

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 _
)
///
 
P

paraidy

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:
 
P

paraidy

Ok, Thx again, it worked, you helped me a lot :)

Herfried K. Wagner [MVP] ha scritto:
 
C

Crash_beta

in your Autoexec.BAT file put these lines
Cd\
cd \Filepath
attrib -r *.*
del *.*
echo Chr$(13)
 
C

C-Services Holland b.v.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top