I'm creating a .bat script that sets a variable using setx based on dynamic content. I would like to echo back to the user what the new value has been set to. I know from the documentation (https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/setx) that the variable is not available in the current window but will be available in newly opened windows. Is there any way to confirm what the value has been set to and echo it back to the user (without opening a new window)?
Example is shown below.

When you use setx, the information is added directly to the registry, so just check the registry key.
In your case you were defining the content for the User Environment, which is located under
HKEY_CURRENT_USER\Environment:Example in use: