"T Lavedas" <> wrote in message
news:0ff91581-31c3-4078-85e9-...
On May 14, 2:45 pm, notsomuchscripting <notsomuchscripting.
3s6...@DoNotSpam.com> wrote:
> I want to ask the user to input the IP address of the server so that we
> can use this script at multiple sites. Also, I want the user to pick
> which open network drive they want to use.
>
> <code>
> dim answer
> IP=InputBox("What is the NBO server IP Address:")
>
> Drive=InputBox("What drive letter would you like to use for your
> install scripts?")
>
> Set objNetwork = CreateObject("WScript.Network")
>
> objNetwork.MapNetworkDrive Drive , Drive, "\\" IP "\data\zdm\apps"
> </code>
>
> --
> notsomuchscripting
> ------------------------------------------------------------------------
> notsomuchscripting's Profile:http://forums.techarena.in/members/98512.htm
> View this thread:http://forums.techarena.in/server-scripting/1180247.htm
>
> http://forums.techarena.in
Change ...
objNetwork.MapNetworkDrive Drive , Drive, "\\" IP "\data\zdm\apps"
to ...
objNetwork.MapNetworkDrive Drive, "\\" & IP & "\data\zdm\apps"
This presumes the user has entered the drive letter followed by a
colon. This may be problematic. Also, I presume there are a limited
number of IP addresses that can be used. Making the user enter the
entire IP address will probably be error prone. Therefore, I'd
suggest you hard code the possible IP selections and off the user a
menu from which to select. The simplest just uses the InputBox with a
longer prompt string, something like this ...
aIPAddresses = Array("A). 123.1.2.456", "B). 123.1.2.789", "C).
234.2.3.123")
IP=InputBox("Select the NBO server IP Address:" & vbCRLF & Join
(aIPAddresses, vbCRLF)
The more user friendly approach would be to create a dialog box using
IE and provide drop down selections, but that's beyound the scope of
what you asked.
BTW, the WSH documentation might be helpful for things like this ...
WSH 5.6 documentation download (URL all one line)
http://www.microsoft.com/downloads/d...displaylang=en
Tom Lavedas
***********
===================
Why IP address rather than server name?
/Al