Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Configuring Wscript.echo to Return Only Variable Info

0 views
Skip to first unread message

Chriswilly

unread,
Oct 25, 2006, 4:21:01 PM10/25/06
to
G'day all,

I would like to use the wscript.echo command, in a *.vbs script, to only
return the specified variable, not a text string and then the variable.

Here's what I don't want:

WScript.Echo "Domain = " & WshNetwork.UserDomain

And here's what I do want:

WScript.Echo & WshNetwork.UserDomain

What is the correct formatting for doing this?

Thanks!

=)

Ray Costanzo [MVP]

unread,
Oct 26, 2006, 7:53:35 AM10/26/06
to
WshNetwork.UserDomain is a string, so just pass it as the argument for the
echo method. The & in your first line simply concatenates "Domain = " and
the value of WshNetwork.UserDomain together to create a string - still just
one string - for the echo method.

Ray at work

WScript.Echo WshNetwork.UserDomain
"Chriswilly" <Chris...@discussions.microsoft.com> wrote in message
news:975ED5B5-23AB-4415...@microsoft.com...

Shenan Stanley

unread,
Oct 27, 2006, 1:30:18 PM10/27/06
to

WScript.Echo WshNetwork.UserDomain

No &.

--
Shenan Stanley
MS-MVP
--
How To Ask Questions The Smart Way
http://www.catb.org/~esr/faqs/smart-questions.html


Chriswilly

unread,
Oct 30, 2006, 1:29:01 PM10/30/06
to
Thanks guys!!

=)

0 new messages