Solved

VBScript statement

Posted on 2006-11-10
5
145 Views
Last Modified: 2010-08-05
I am wanting to echo to the name of the local system by querying the %computername% environment variable.

Wscript.echo %computername% doesn't work.

Can ya help me with the syntax?

Thanks,
JohnD
0
Comment
Question by:johndarby
  • 2
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 17916992
Greetings, johndarby.

Set objNetwork = CreateObject("Wscript.Network")
Wscript.Echo objNetwork.ComputerName

Cheers!
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 17917048
0
 
LVL 1

Author Comment

by:johndarby
ID: 17917288
Thanks alot, BlueDevilFan!

Also, Gecko, I appreciate your input.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 17917877
You're welcome.
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 17918963
You're welcome, sorry about not saying much ( That was a vba example obviously ) but what I was getting at was that you could just use Environ("ComputerName")

I think there is a bit more to it then just that but the first solution is a good one.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now