中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-02 01:29
48,037 topics / 350,122 posts / today 2 new / 48,250 members
DOS批处理 & 脚本技术(批处理室) » Newbie question: using the computer name as a filename prefix
Printable Version  823 / 2
Floor1 niuji Posted 2006-08-16 17:08
初级用户 Posts 14 Credits 52
netstat -n > "E:\niuji\%hostname%_netstat--n.txt"


It ended up creating a file called _netstat--n.txt, and it didn't use the computer name as a prefix at all.
What do I need to do to use the computer name as a prefix?
Thanks!!
Floor2 electronixtar Posted 2006-08-16 17:13
铂金会员 Posts 2,672 Credits 7,493
%computername%

Type set and take a look at the variables, then you'll see you used the wrong one
Floor3 niuji Posted 2006-08-16 17:23
初级用户 Posts 14 Credits 52
My god, thanks!
hostname is from Unix
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023