Solved

VBScript statement

Posted on 2006-11-10
5
148 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

756 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