Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VBScript statement

Posted on 2006-11-10
5
Medium Priority
?
152 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

715 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