Waiting for entire file to appear before execution
Hello,
I'm trying to wait until an application is downloaded before executing it. Unfortunately, I'm having problems because it will execute the file before the application is fully downloaded.
As you can see, I'm forced to use Sleep() to give it enough time to fully download, but I'd like a more reliable way of doing this. I thought of checking for the full size of the desired file before execution, but the file being downloaded may vary in size a great deal, so that wouldn't be sensible either.
you could try to open the exe file exclusively. if that works the file is closed.
another idea is to download the file using a different name (or extension) if you have control of the download process. then wait on change file name notification.
Open in new window