1.

Solve : Extract computer alias in batch file?

Answer»

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?

Thankshttp://www.jsiinc.com/subd/tip1700/rh1786.htmThat works, but again I do not WANT to use %COMPUTERNAME%, i would like to use the alias I added in the hosts file.see if you can find something here>http://search.microsoft.com/search/results.aspx?st=b&View=en-us&s=6&c=0&qu=alias



Discussion

No Comment Found