Thanks guys! Referring to the link posted in #5 [
above] this is what I did:
01 - Booted my "test" VM from an ISO [offline] image
02 - Deleted "write.exe" from the VM's "Windows" folder
03 - Booted the VM normally
04 - Tested and fixed my batch file
The original problem [and question] arose because sfc does not return %errorlevel% codes, so I had to use statements like these below to interpret the results via a "temporary" file
sfc /VERIFYONLY > %Temp%\%~n0-sfc-ver.txt
find "Windows Resource Protection did not find any integrity violations" %Temp%\%~n0-sfc-ver.txt >nul
They allow me to check whether I got a good result or not [by checking the %errorlevel% returned by "find"]. I am then able to trigger a "sfc /SCANNOW" code block [using the same method to check
that result] if necessary.
All great, ta. And I now know that "write.exe" is a "safe" file to delete in order to force an error for test purposes.