Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Other Programming > VBScript
|
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old February 24th, 2005, 11:12 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default Question on .vbs file

I am working on a .vbs file where I need to be able to acquire the server name that this .vbs file is running on. Is there a way in vbscript to acquire the server name without using asp?

Thanks for any direction or help anyone can give.
Reply With Quote
  #2 (permalink)  
Old February 24th, 2005, 11:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Code:
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "Computer Name = " & WshNetwork.ComputerName
rgds
Phil
Reply With Quote
  #3 (permalink)  
Old February 24th, 2005, 12:12 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thank you so much for your time and the reply. That got it.
Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I attach a file to an email in my .vbs file savoym VBScript 3 July 2nd, 2011 08:02 AM
xp_cmdshell to run VBS file madhusr SQL Language 1 December 1st, 2008 02:09 PM
Executing .vbs file from asp dsmike2008 Classic ASP Professional 0 July 17th, 2008 11:01 PM
Scheduling VBS file madhukp VBScript 1 September 22nd, 2004 07:14 AM
HELP with .VBS file savoym VBScript 1 July 31st, 2003 08:39 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.