Re: a self deleting program
- From: "Michael C" <nospam@xxxxxxxxxx>
- Date: Tue, 15 May 2007 13:45:39 +1000
"Ralph" <nt_consulting64@xxxxxxxxx> wrote in message
news:p_KdncjNfdnmitTbnZ2dnUVZ_qupnZ2d@xxxxxxxxxxxxxxx
I'm with Larry, I didn't see it as being that big of a problem, but was
curious why you did. I asked for an explanation, and you gave it. While I
can understand some of your concerns, I still don't see it as a 'bad
solution', if it works.
As it said, it's very likely to fail.
My guess no one bothered to reply with a 'workaround' because in practical
use - none is needed.
Or none is available. If permissions deny you creating a batch file then
what possible solution is there?
"... it has no timeout, hence no error warning"
I don't see that as problem because who would it report the timeout or
error
to? And what would the program do when it received an error? I can't think
of any process that wouldn't have an opportunity to fail - given the right
circumstances.
It could popup a messagebox, it could use the move file api suggested
elsewhere. At the very least it could stop using 100% cpu.
"... permissions might deny running a bat file."
More possible for a .bat or .com file than a .exe perhaps. If the
environment is unfriendly, its just unfriendly. Can happen to anyone.
That is true.
"If it fails it will sit on 100% cpu forever and cause problems shutting
down." I doubt that - all its doing is deleting a file, if it fails it
fails. if it hangs it hangs. Windows shutdown is very good at killing off
unresponsive apps.
I just tried and it did sit on 100%. Windows might shut it down without a
message i'm not sure. Then again it might come up and ask you to kill the
app.
But again, it might happen to any process.
Sure but no point hedging your bets.
"If we need to add functionality we will be restricted to batch file
commands hence it is inflexible."
What functionality? It is attempting to delete a file.
A timeout would be good. Can a batch file do that? A message would also be
good. The move file api might also be handy.
"But the real reason for not doing this is that it just feels wrong."
It doesn't fell that wrong to me, assuming it works. Howerver, I'm not
that
convinced it will.
You're not convinced it doesn't work yet it doesn't feel wrong?
As for the rest of your points, upsetting virus-checkers, etc. That's the
risk you would run with any solution, except...
That's the risk you run if you implement poor solutions like this!!! If you
do things properly you minimise your chance of your program looking like a
virus. Should this happen it will give your app an *extremely*
unprofessional look.
IMHO, I prefer Steve's suggestion. Sometimes we get too cute - Windows
offers this kind of service - why not just use it.
Quite possibly another solution altogether exists, as we don't really know
why the OP is trying to delete the file.
Michael
.
- Follow-Ups:
- Re: a self deleting program
- From: Robert Morley
- Re: a self deleting program
- References:
- Re: a self deleting program
- From: Tony Proctor
- Re: a self deleting program
- From: J French
- Re: a self deleting program
- From: Michael C
- Re: a self deleting program
- From: Ralph
- Re: a self deleting program
- Prev by Date: Re: a self deleting program
- Next by Date: Re: a self deleting program
- Previous by thread: Re: a self deleting program
- Next by thread: Re: a self deleting program
- Index(es):
Relevant Pages
|