XP won't let me delete a file.

M

mike

XP Pro SP2
I have a program written in VB6.
The program seems to do what I programmed it to do.
Problem is that after I run the exectuable, I can no longer
delete the executable file. VB6 won't let me recompile the program
because it can't delete the old executable. Rebooting the system
makes the file deletable until the next time I run it. The error
message is, "remove write protection." I remember seeing an error
message to the effect, "someone else is accesing the file," but
I can't reproduce that error message. Yes, I checked the properties page
it's NOT read-only.

The interesting thing is that I can take a different executable, rename
it to the same name as the naughty program and successfully copy the
new program over the naughty one. The new program executes just like it
should. But it isn't deletable either.

I've poked around in process explorer. I can see my program come
and go. I found no obvious stuff left running in its wake. All I
have to do is load the form and exit the program to cause this symptom.
I'm not running much of my program at all.

This problem does NOT happen if I execute it on a Win2K SP4 system.
I have a laptop with XP HOME SP2. The problem does NOT happen there either.
I tried the VB newsgroups, but they sent me here.

Suggestions?
Thanks, mike
 
P

philo

mike said:
XP Pro SP2
I have a program written in VB6.
The program seems to do what I programmed it to do.
Problem is that after I run the exectuable, I can no longer
delete the executable file. VB6 won't let me recompile the program
because it can't delete the old executable. Rebooting the system
makes the file deletable until the next time I run it. The error
message is, "remove write protection." I remember seeing an error
message to the effect, "someone else is accesing the file," but
I can't reproduce that error message. Yes, I checked the properties page
it's NOT read-only.

The interesting thing is that I can take a different executable, rename
it to the same name as the naughty program and successfully copy the
new program over the naughty one. The new program executes just like it
should. But it isn't deletable either.

I've poked around in process explorer. I can see my program come
and go. I found no obvious stuff left running in its wake. All I
have to do is load the form and exit the program to cause this symptom.
I'm not running much of my program at all.

This problem does NOT happen if I execute it on a Win2K SP4 system.
I have a laptop with XP HOME SP2. The problem does NOT happen there either.
I tried the VB newsgroups, but they sent me here.


The process must still be running
in the background..
hit contol-alt-delete and kill the process
 
M

M.I.5¾

mike said:
XP Pro SP2
I have a program written in VB6.
The program seems to do what I programmed it to do.
Problem is that after I run the exectuable, I can no longer
delete the executable file. VB6 won't let me recompile the program
because it can't delete the old executable. Rebooting the system
makes the file deletable until the next time I run it. The error
message is, "remove write protection." I remember seeing an error message
to the effect, "someone else is accesing the file," but
I can't reproduce that error message. Yes, I checked the properties page
it's NOT read-only.

The interesting thing is that I can take a different executable, rename
it to the same name as the naughty program and successfully copy the
new program over the naughty one. The new program executes just like it
should. But it isn't deletable either.

I've poked around in process explorer. I can see my program come
and go. I found no obvious stuff left running in its wake. All I
have to do is load the form and exit the program to cause this symptom.
I'm not running much of my program at all.

This problem does NOT happen if I execute it on a Win2K SP4 system.
I have a laptop with XP HOME SP2. The problem does NOT happen there
either.
I tried the VB newsgroups, but they sent me here.

The only thing that I can think of is that for some reason the excutable
file is not exiting. If Windows is still holding the file in memory then
you won't be able to delete it.

Next time you run it and you think it should have exited, open up task
manager (Ctrl-Alt-Del and select 'Task Manager') and see if your executable
is still a current process.
 
M

mike

M.I.5¾ said:
The only thing that I can think of is that for some reason the excutable
file is not exiting. If Windows is still holding the file in memory then
you won't be able to delete it.

Next time you run it and you think it should have exited, open up task
manager (Ctrl-Alt-Del and select 'Task Manager') and see if your executable
is still a current process.
Thanks,

I stated in paragraph 3 of my original posting that I have
looked in Process Explorer, which is task manager on steroids.
There's only one process.

When I exit the program, the process goes away.
Yes, I did try task manager and the result is the same.

If I attach the debugger and then close the program, the last line of
the diagnostic output is:

The program 'D:\flashtest\flashtest.exe' has exited with code 0 (0x0).

There's another quirk.
This happened about a week ago. I went thru my form load procedure
(that's all I have to run to cause the problem)
commenting out code and recompiling (rebooting each time) until the
problem went away. Then I went back and started re-enabling code.
I put back ALL the code and the symptom was still gone.

I've been tweaking on the VB6 program successfully for a week.
All of a sudden the symptom is back. I can't delete the executable.

I started my quest in a VB newsgroup. They sent me here.
Sounds like a VB problem, but the symptom only happens on my XP PRo
machine and not on XP home or Win2K.

mike
 

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

Similar Threads


Top