This is a nice trick to block application execution, for example, if you’re deploying an Outlook plugin just add the following reg keys to stop the end user re-launching Outlook after it’s closed.
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\outlook.exe" /v Debugger /t REG_SZ /d "%1"
The %1 will simply do nothing, if you click the outlook shortcut nothing at all will happen.
Once the installation is complete remember to remove the reg key!!
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\outlook.exe" /f
That’s it, it works really nicely for something so simple. You could get creative and replace the %1 to launch a message box and tell the user to wait!
Cheers