Re: scripting gethostbyname
- From: "mayayana" <mayayanaXX1a@xxxxxxxxxxxxxxxx>
- Date: Sun, 30 Oct 2005 15:32:04 GMT
You can't do that in VBScript or javascript.
Perl is using some kind of component
("use Socket"). To call Winsock functions
in any other script you need to do the
same thing: Wrap the function in a component
that "pre-digests" it to a form that the script
can handle.
--
mayayanaXX1a@xxxxxxxxxxxxxxxx
(Remove Xs for return email.)
roger <rsr@xxxxxxxxxxxxx> wrote in message
news:Xns96FED7E31A76Crsrrogerwarecom@xxxxxxxxxxxxxxxx
> Here's a 3 line perl script that prints the IP address of a named host:
>
>
> use Socket;
> $packed = gethostbyname("$ARGV[0]") or die "unknown host: $ARGV[0]\n";
> print inet_ntoa($packed);
>
>
> Use like so (host name can be found via DNS or in local hosts file)
>
>
> WINSERVER:rsr>perl gethostbyname.pl winserver
> 192.168.0.4
>
> WINSERVER:rsr>perl gethostbyname.pl msnews.microsoft.com
> 207.46.246.16
>
>
> How does one do that with windows scripting?
>
> Thanks very much.
>
>
>
.
- Follow-Ups:
- Re: scripting gethostbyname
- From: Steven Cheng[MSFT]
- Re: scripting gethostbyname
- From: Michael Reese
- Re: scripting gethostbyname
- References:
- scripting gethostbyname
- From: roger
- scripting gethostbyname
- Prev by Date: scripting gethostbyname
- Next by Date: Re: function to get names from text file
- Previous by thread: scripting gethostbyname
- Next by thread: Re: scripting gethostbyname
- Index(es):
Relevant Pages
|