Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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
 
Old July 27th, 2007, 11:14 AM
Registered User
 
Join Date: Jan 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Find IP Address for .vbs file

Hi all,

I am developing a .vbs file which will be executed by a server schedule. When the script is executed it need to look at the Server IP address where the script resides.

I originally developed it in ASP using vbscript and it worked fine running through a browser using :-

Request.Servervariables("LOCAL_ADDR")

Unfortunately when I try and run this file manually by double clicking it through File Manager (not through the browser) it simply does not work. There is no error. I know that the script is failing at this point.

Does anyone know how I can find out the IP address where the script resides within a .vbs file?

I appreciate any help.

Thanks

Use you brain, not your brawn!
 
Old July 27th, 2007, 12:58 PM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

When you run it with an ASP, it is being run under the auspices of a web process (I am using that not as a technical term, but as a descriptive one).

When you double-click the file, you are not.

I think I would put the results of .ServerVariables("LOCAL_ADDR") into a variable. Then I would add a test to see if the veriable received any results. If not, then I would try something like CurDir(), or something else along those lines.

But the bottom line is that there is no IP Addr when you double-click the file.





Similar Threads
Thread Thread Starter Forum Replies Last Post
find External IP Address in VB.NET remya1000 General .NET 2 March 4th, 2014 12:31 AM
Help me i must Get IP Address pla_2 C# 2005 2 October 12th, 2006 07:51 AM
IP Address sumanghosh Classic ASP Basics 1 April 7th, 2006 11:24 AM
Retreiving IP address & gateway address sjangit VBScript 0 February 3rd, 2004 02:02 PM





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