• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 159
  • Last Modified:

VBScript statement

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
John Darby
Asked:
John Darby
  • 2
  • 2
1 Solution
 
David LeeCommented:
Greetings, johndarby.

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

Cheers!
0
 
gecko_au2003Commented:
0
 
John DarbyPMAuthor Commented:
Thanks alot, BlueDevilFan!

Also, Gecko, I appreciate your input.
0
 
David LeeCommented:
You're welcome.
0
 
gecko_au2003Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now