Page 1 of 1

Host name via batch file

Posted: 29 Sep 2011 04:17
by dostips12
Hi everybody

How can make host name via batch file
so if the ip address change i can go to my computer by using that host name address with out knowing the ip address

Re: Host name via batch file

Posted: 29 Sep 2011 10:05
by alleypuppy
I know this works on Windows XP. If you are using Windows Vista/7 andd it doesn't work, post a reply and I'll fix it.

Code: Select all

for /f "tokens=16" %%a in ('ipconfig /all ^| find "Host Name"') do set HOSTNAME=%%a

Re: Host name via batch file

Posted: 29 Sep 2011 13:18
by dostips12
Thank you alleypuppy
now if i want to use remote desktop
can i use this host name without knowing ip address????
what if there is some one have same host name??

Re: Host name via batch file

Posted: 29 Sep 2011 15:31
by alleypuppy
Do you mean use the host name instead of the IP Address to connect to a computer? You can use the hist name instead of the IP Address.

And two computers cannot have the same host name on the same network.

Re: Host name via batch file

Posted: 29 Sep 2011 15:45
by dostips12
what is hist name??
and the connect between 2 computer not in same network but via enternet the first computer in work and the other in home.

Re: Host name via batch file

Posted: 29 Sep 2011 21:12
by alleypuppy
Oops! Sorry, I meant host name, not hist name.

And since the two computers aren't on the same network, you cannot use the host name because the host name is used in LAN environments only.

If you want to connect to your work computer from home, just use LogMeIn (http://www.logmein.com). It's basically Remote Desktop for computers on different networks.