When I enter "hostname" into the Windows Command Prompt, I get the expected hostname of the system, but I can't seem to include it in any string output, either assigned to another variable, or just as itself.
The below script outputs "Ready to copy to Server of Is this the correct location?" and all variations of using hostname seem to result in the same.
@echo off
set hostnamevar=%hostname%
set "greeting1=Ready to copy to Server of "
set "greeting2=Is this the correct location?"
set "greeting=%greeting1%%hostnamevar%%greeting2%"
echo %greeting%
pause