Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 153
  • 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
johndarby
Asked:
johndarby
  • 2
  • 2
1 Solution
 
David LeeCommented:
Greetings, johndarby.

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

Cheers!
0
 
gecko_au2003Commented:
0
 
johndarbyAuthor 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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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