I would like to convert this /bin/sh
syntax into a widely compatible Windows batch script:
host=`hostname`
echo ${host}
How to do this so that it'll work on any Windows Vista, Windows XP, and Windows 2000 machine?
To clarify: I would then like to go on in the program and use the hostname as stored in the variable host
. In other words, the larger goal of the program is not to simply echo the hostname.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…