Re: Can't delete .avi file after playing in WMP

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Looking at the file with Windows Explorer after deletion, it's the
same length file. If you try to play it outside the program (but
before the program is closed) you get an error that says it can't
access the file.

Per my previous post, I'm pretty sure it's just because explorer hasn't
been updated so it's still showing it. But if you click on it, you get
the error message it's not there of course (can't access it). Try
updating/refreshing Explorer; I'm betting the errant entry will go away.
If it doesn't, try closing/opening explorer to force a disk re-read;
that always seems to work to get the list accurate.


The file example I included is the entire program. I thought
something else might be going on so I tried to make it as simple as
possible. No other code is acessing the file. I'm not forcing the
the WMP to be visible, just walking through with F8 in the debugger.
I've put an End statement at the end of the Form_Load sub, put a
me.show statement end, all with the same results.

As I said I think it's all in the OS, not VB. For some reason messages
aren't getting to explorer properly to update the display. When
explorer's display actually gets updated, the file will no longer be
there.

Twayne


sr

"Dave O." <nobody@xxxxxxxxxxx> wrote in message
news:e9aYFkkmIHA.4140@xxxxxxxxxxxxxxxxxxxxxxx
Is the file that is left after "deletion" the same file, or is it a
zero length file?
If it is you are probably opening the file somewhere else, but as it
does not exist a zero length file is created instead - perhaps?
Plainly there is something else going on because normally the form
and any WMP on it will not be visible until after the Form_Load
subroutine has finished, so how are you forcing the WMP to be
visible and what other code is accessing the AVI file?

Regards
Dave O.

"Steve Ricketts" <velocedge@xxxxxxxxxxx> wrote in message
news:uBcVgdkmIHA.1208@xxxxxxxxxxxxxxxxxxxxxxx
I thought I had this fixed, but it's happening again, but it seems
like only with avi files. In VB6 if I play an .avi file in WMP and
then delete the file, it's not removed until the program closes. To
make sure I wasn't missing something, I wrote a very simple test
program. private sub Form_Load()
me.WindowsMediaPlayer1.URL = "d:\hd.avi"
do until me.WindowsMediaPlayer1.playState = wmppsStopped
doevents
loop
me.WindowsMediaPlayer1.URL = ""
kill "d:\hd.avi"
Debug.Print Dir("d:\hd.avi") ' displays nothing so the program
thinks it's deleted
end sub

d:\hd.avi remains visible in Windows Explorer. And if you try to do
anything with the .avi file in VB, VB thinks it's not there. I also
notice that if I look at WindowsMediaPlayer1.currentMedia.sourceURL
after the kill statement, the value is "d:\hd.avi" which seems odd.

Any ideas what's happening here?

Thanks,

Steve



.



Relevant Pages

  • Re: Cant delete .avi file after playing in WMP
    ... I seem to recall having this problem once when I used WMP to play MP3 files. ... | reproduce the same behavior with the simple test program I included in my ... |>> The avi file plays fine before you run the program. ...
    (microsoft.public.vb.general.discussion)
  • Re: How can I make Windows Media Player play all tracks of a VCD?
    ... Music Files: Play with WMP; Explorer ... WMP" for both "Music Files" and "Video Files" and it did not help. ...
    (microsoft.public.windowsmedia.player)
  • Re: track number in the id3 tag data
    ... play order. ... if it's going to be ignored by the player? ... You are in a context (Explorer) in which they are not being paid attention ... See http://zachd.com/pss/pss.html for some helpful WMP info. ...
    (microsoft.public.windowsmedia.player)
  • Re: Cant delete .avi file after playing in WMP
    ... Looking at the file with Windows Explorer after deletion, ... If you try to play it outside the program (but before the ... WMP on it will not be visible until after the Form_Load subroutine has ... In VB6 if I play an .avi file in WMP and then delete ...
    (microsoft.public.vb.general.discussion)
  • Re: track number in the id3 tag data
    ... on the album folder in explorer" ... I will play around with library options in the actual player instead and see ... I then right click an album folder and then choose "play with ... See http://zachd.com/pss/pss.html for some helpful WMP info. ...
    (microsoft.public.windowsmedia.player)