Computing.Net > Forums > Programming > Extract comp. alias in a batch file

Extract comp. alias in a batch file

Reply to Message Icon

Original Message
Name: zanman7
Date: September 14, 2004 at 13:25:43 Pacific
Subject: Extract comp. alias in a batch file
OS: windows 2000 sp3
CPU/Ram: Intel 2.8GHz/512MB
Comment:

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


Report Offensive Message For Removal








Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Extract comp. alias in a batch file

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge