During software installation I need to have some code run after the next restart. To do this I am placing a link to the EXE under this registry key:
Software\Microsoft\Windows\CurrentVersion\RunOnce
My question is, where should I put the EXE itself? The EXE is not needed after it runs and the installer does not create any folder under Program Files where I could just put it. Would it be safe to put it under %TEMP%? I am afraid that by the time Windows restarts the %TEMP% might be cleaned and the EXE removed. I can create a folder under Program Files and put it there but then the folder will stay there forever after it ran once.
Any recommended behavior?