The environment variables that are set by the various batch files installed by vs 2022 such as the developer command prompt are only in effect for the command prompt window that the batch files open.
When you close one of these command prompt windows the environment variables that were set go out of existence with them. Afterwards, it is not necessary to reboot your system.