This snippet will save the hostname of a PC to an environment variable.
for /f "delims=" %%A in ('hostname') do set hostname=%%A
echo %hostname%
It loops over the output and keeps setting the variable. Cool.
for /f "delims=" %%A in ('hostname') do set hostname=%%A
echo %hostname%
No comments:
Post a Comment