Detecting .exe closed and copying files

I hit a snag on this new project. As always, any recommendations would be greatly appreciated.

First: My organization has 2 scanner models; Fujitsu 7160 and Fujitsu 7260.
An SCCM deployment will take place to drop 2 folders and 3 pre-configured files for each on the target PCs.

Here: C:\Program Files (x86)\Kofax Set Default Scanner
Folder1: Fujitsu 7160
Folder2: Fujitsu 7260

Custom configured files in each folder specific to each model:
Default settings.cps
Default traps.cts

I have a utility (.exe) that will need to launch manually by one of our techs. For this I’ll simply launch the following through a PS shortcut. Start-Process -FilePath "C:\Program Files (x86)\Kofax\Capture\ImgCtls\Bin\ScannerConfigUtil.exe”

This opens the scanner selection utility and allows a tech to select one of the scanner models above, they’ll then choose “set as default”, and close it. The selection upon clicking “set as default” button writes the model to a Registry location.

Here: HKLM:\SOFTWARE\WOW6432Node\Kofax\Condor\1.0\KfxScan.Pxw
-Name Default Source –Value <u>Fujitsu fi-7160 with SVRS with AIPE</u>

Here’s where I’m stuck… (waitforexit?)
I need my Powershell to detect when the ScannerConfigUtil.exe closes or stops process in Task Manager, which indicates the tech is done and values are now passed to Reg, either 7160 or 7260 as shown above. Then, check which model (Test-Path?), and depending on model number, copy the 3 associated files from their folder location (shown above) to their actual locations (shown below), replacing the ones already there by default. This way, if a tech changes the physical scanner model, changing the default from the utility would detect, grab files and overwrite accordingly.

Copy to Location: C:\ProgramData\Kofax\Vrs
File: Default traps.cts
File: KofaxReg.xml

Copy to Location: C:\Program Files (x86)\Kofax\Capture\ImgCtls\bin\Profiles
File: Default settings.cps

Is this even possible with PS? Hopefully this makes sense…

Thank you all.

Start-Process -FilePath "C:\Program Files (x86)\Kofax\Capture\ImgCtls\Bin\ScannerConfigUtil.exe” -wait will wait for the exe execution. You can then read the registry entry.