Re: a self deleting program

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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


.



Relevant Pages

  • Re: success-path-only software
    ... Someone might assume that these operations will never fail, ... The second code might be harmful when delivered to a customer, ... this is an advantage of having exception handling and a language that checks ... rather than just having the whole app die). ...
    (comp.lang.misc)
  • Re: App fails on Windows, but works on OS X.
    ... I think windows makes a distinction between scripts and executables, and ruby is a script language. ... I wonder what happens if you run a tool to convert the ruby app to an exe if it would still fail or maybe fail with some error message that might give a better clue about what is wrong ... App fails on Windows, ... The systems I tried were all on separate networks, ...
    (comp.lang.ruby)
  • Re: possible cause for DDERR_UNSUPPORTEDMODE?
    ... doing a simple sleep and check loop prevents my app from dying and ... [Microsoft Direct3D MVP]) wrote: ... subsequent calls to directx api will fail horribly and crashes the ... with DDraw myself. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: [PATCH 3/6] ksm: change the KSM_REMOVE_MEMORY_REGION ioctl.
    ... KVM has been in the kernel for years without being able to swap ... Fail surely is more helpful. ... But there's no reason to forbid the app to know about it. ... it's not big deal if all users can register, ...
    (Linux-Kernel)
  • Re: generalizations
    ... To fail to make that effort is to risk being bigots in the ...
    (soc.atheism)