Jump to content

Unable to delete some files


sambuddy
 Share

Recommended Posts

Hello, I've written a script that will create some text files. At the end of the script, I go through and delete all the files left in the directory. All but the text files get deleted.

Here is the code I am using to delete them.

Does anyone have any suggestions?

Thanks

;******************************************************************************

Func FINISH()

ExitFileDelete($current_directory & "\WOWVisibleOfferIcon.mux")

FileDelete($current_directory & "\vpes.exe")

FileDelete($current_directory & "\pes2tp.exe")

FileDelete($current_directory & "\otvsi.psi")

FileDelete($current_directory & "\mpeg2mux.exe")

FileDelete($current_directory & "\internal.m2v")

FileDelete($current_directory & "\internal.m2a")

FileDelete($current_directory & "\audiopkt.exe")

FileDelete($current_directory & "\AV.mux")

FileDelete($current_directory & "\app.mux")

FileDelete($current_directory & "\hinfo.exe")

FileDelete($current_directory & "\vpes_out.txt")

FileDelete($current_directory & "\hinfo.txt")

FileDelete($current_directory & "\audiopkt_out.txt")

FileDelete($current_directory & "\mpeg2mux_av_out.txt")

FileDelete($current_directory & "\pes2tp_audio_out.txt")

FileDelete($current_directory & "\pes2tp_video_out.txt")

FileDelete($current_directory & "\mpeg2mux_stream_out.txt")

FileDelete($current_directory & "\AV.vps")

FileDelete($current_directory & "\AV.vtp")

FileDelete($current_directory & "\AV.aps")

FileDelete($current_directory & "\AV.atp")

EndFunc

;******************************************************************************

Link to comment
Share on other sites

Have you tried using FileClose on the text files to ensure that they are closed.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

Try to change attributes of files. I prefer following way of file-delete

$error = FileSetAttrib( $file_name, "-RSH")
If $error <> 1 Then
  MsgBox(4096,"Attributes","Setting of attributes is not working" & @CRLF & $error)
  Exit
EndIf

$error = FileDelete( $file_name)
If $error <> 1 Then
  MsgBox(4096,"Deleting","Deleting error" & @CRLF & $error)
  Exit
EndIf
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...