You can use the %Computername%
variable for the local computer.
xxcopy "\\%Computername%\G$\sample\" "\\NAS1\Volume_1\sample\"
If you extract the %Computername%
variables from all your machines then you can hard code them into your backups scripts.