You need to run an application or batch file before the download is complete Windows.
It's impossible!No Windows application will not work to boot the system.
This feature is implemented in many programs for partitioning
You misunderstand the situation - this kind of program work in Windows Preinstallation Environment (WinPe) is a lightweight version of windows which is fully contained in memory, the same environment which is used during windows setup.
It is based a LiveCD to restore system, set of tools for maintenance, etc.
In this environment you can run the disk partitioning tools, system utilities, tools, network, remote access tools(e.g. it's), etc.