It looks like the issue is caused by the environment variable PATH being corrupted. Try to build the following model -
and look for the "devnull.2" file in the generated folder "xpcosc_slrt_rtw". If this the problem the file will have multiple lines stating: "'REG' is not an internal or external command, executable program or batch file."
To further confirm an issue with the PATH environment variable, open a Windows Command Prompt and type: "REG /?". Normally, it will display all the usages of the "REG" command. If different behavior is encountered, try the following:
Append the following to the PATH environment variable: C:\Windows\System32
This is the location of the "reg.exe". Adding this location to the PATH environment variable will resolve the issue.