If you want to hide the big ugly black command window of the default prestart command wizard hook. You can fin one way to do that at Alexsemi’s Blog.
His version is to workaround the inject of SCCM MDT with cscript.exe, by wrapping it with an AutoIt exe. This way OSD won’t replace the wscript.exe call with cscript.exe. So there is no window visible.
But because I don’t like to have any unnecessary files, I found a solution with a PowerShell call.
This requires that you have PowerShell included in your Boot Image, but because PowerShell is really powerful and easy to use in OSD deployment, I can suggest to start using it anyway.
The solution is simple, just replace the default prestart command
1 |
wscript.exe Deploy\Scripts\ZTIMediaHook.wsf |
with the following:
1 |
PowerShell.exe -WindowStyle Hidden -NoProfile -Command "wscript.exe Deploy\Scripts\ZTIMediaHook.wsf | Out-Host" |
With it, you have the same effect without additional files if you already have PowerShell included in the Boot Image.
Note: Pipe to Out-Host is one way to force PowerShell to wait for the process to finish.
Update:
I just realized , that there is still for a short amount of time a PowerShell console visible. I researched a bit and found out, that this is a limitation, because PowerShell is a console application for which Windows always creates an Console first. PowerShell just hide it as soon as possible with the “Hidden” parameter given.
So if you can’t accept that short “Popup” than you have to use a wrapper as described in Alexsemi’s Blog.