Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Extract computer alias in batch file  (Read 4921 times)

0 Members and 1 Guest are viewing this topic.

zanman7

  • Guest
Extract computer alias in batch file
« on: September 14, 2004, 12:59:18 PM »
I am trying to use the hostname as a conditional in a batch file.  I would like to use the alias (not %COMPUTERNAME% mind you) I added to the hosts file and have to make no other changes (i.e. set an env var at startup).  This would be equivalent to doing a "hostname -a" in Unix and greping for the alias name.  I haven't found any evidence that parsing exists using batch so I guess I just need a command that will return that alias.  Is it out there or any nifty work arounds?

Thanks

merlin_2

  • Guest

zanman7

  • Guest
Re: Extract computer alias in batch file
« Reply #2 on: September 14, 2004, 02:03:40 PM »
That works, but again I do not want to use %COMPUTERNAME%, i would like to use the alias I added in the hosts file.

merlin_2

  • Guest
Re: Extract computer alias in batch file
« Reply #3 on: September 14, 2004, 02:34:11 PM »