My application needs to delete some files, but this should happen until next windows startup.
What I'm doing now is to write this string value in RunOnce registry key:
Command.com /c del c:\some file.ext
but I observe a problem with paths with embedded spaces. I have to say I tried this one too:
Command.com /c del "c:\some file.ext"
But this does not resolve the problem, but make it worst: not deletion of any file, regardless of embedded spaces!
What is the correct way to delete files from my program delayed to the next reboot?
Thanks.
command.com
.command.com
was used in Windows 9x! Since Windows XP we usecmd.exe
instead! – Coenosarcdelphi
but never mentioned how your problem is connected with Delphi (which turned out to be the most important part of your question). So, while learning Delphi, be careful to learn how to ask questions too. :) – GendronRunOnce
working, it will fail if the user doesn't have administrator access. – Celestyna