after the upgrade I get the above mentioned error.
Where do you see that error? In the WPF program? In the bat file?
in this case does nothing but running a BAT file.
Add logging to the bat file to display a few items and call the program. Capture both stdout and stderr.
set log=C:\Temp\MyLog.txt
echo %date% %time% BAT file invoked. >> %log% 2>&1
whoami.exe >> %log% 2>&1
echo %date% %time% Contents of current directory >> %log% 2>&1
dir >> %log% 2>&1
echo %date% %time% Calling external program. >> %log% 2>&1
C:\Apps\Whatever.exe >> %log% 2>&1
echo %date% %time% Whatever.exe ended. RC=%errorlevel% >> %log% 2>&1
Have you reviewed the application and system eventlogs when the error occurs?
You may need to run Process Monitor and trace the failure. Start by looking for "access denied" events.
https://learn.microsoft.com/en-us/sysinternals/downloads/procmon