tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 VB Script > Shell > Computer Name

Computer Name 

This example show accessing computer name and domain.

File Name  :  
source/VBS/shell/comp_name.vbs 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
1'Instantiate network service object
2Set netObj = CreateObject("Wscript.Network")
3 
4WScript.echo "Computer name : " & netObj.ComputerName
5WScript.echo "User Domain : " & netObj.UserDomain
6WScript.echo "User name : " & netObj.UserName

It gives the following output,
Computer name : BETHECODER
User Domain : MSO
User name : kvsudhakar



 
  


  
bl  br