How to execute command through VBScript?

Hi All,

We have HP ovo Installation of 150 servers.

After installing we are executing few commands in command prompt.

These are the below commands.

1. ovconfchg -ns bbc.cb -set CLIENT_BIND_ADDR 10.1.1.1(10.1.1.1 IS THE IP ADDRESS OF THE SERVER)

2.ovconfchg -ns bbc.http -set CLIENT_BIND_ADDR 10.1.1.1(10.1.1.1 IS THE IP ADDRESS OF THE SERVER)
3.ovc -kill
4.ovc -start
5.ovconfchg -ns bbc.http -set PROXY "esos-sdn:9077-(servername)+(*)"

Please anyone create a script for above commands and also it will prompt to ask to add IP address and Server Name

Any assistance could offer would be greatly appreciated.

jashir101Asked:
Who is Participating?
 
Steve KnightIT ConsultancyCommented:
You can do it from vbscript but a batch file would be as easy:

@echo off
set /p ipaddress=Enter IP Address [default %IPAddress%]:
set /p server=Enter server [default %server%]:
ovconfchg -ns bbc.cb -set CLIENT_BIND_ADDR %ipaddress%
confchg -ns bbc.http -set CLIENT_BIND_ADDR  %ipaddress%
ovc -kill
ovc -start
ovconfchg -ns bbc.http -set PROXY "esos-sdn:9077-(%server%)+(*)"

Steve
0
 
Steve KnightIT ConsultancyCommented:
If you want to do it form VBScript you can use shell commands:


dim server,ipaddress

server=inputbox("Please enter servername")
ipaddress=inputbox("Please enter IP Address")

if server="" or ipaddress="" then
  msgbox "You did not enter and IP address or Server Name.  Quitting...."
  wscript.quit
end if

shell "ovconfchg -ns bbc.cb -set CLIENT_BIND_ADDR " & ipaddress
shell "confchg -ns bbc.http -set CLIENT_BIND_ADDR  " & ipaddress
shell "ovc -kill"
shell "ovc -start"
shell "ovconfchg -ns bbc.http -set PROXY ""esos-sdn:9077-(" & server & ")+(*)"""

Open in new window

0
 
jashir101Author Commented:
Thanks for your reply dragon.

However im getting error while trying to execute the script. Please see the below screenshot.

Please fix the issue ASAP... error
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
jashir101Author Commented:
NB: Im executing script on windows server 2003 and 2008.
0
 
Bill PrewCommented:
Did you try Steve's first post of a BAT script approach, that would be the simplest approach.

This adjustment to the VBS code should remove the error you hit.

dim server, ipaddress, WshShell

server=inputbox("Please enter servername")
ipaddress=inputbox("Please enter IP Address")

if server="" or ipaddress="" then
  msgbox "You did not enter and IP address or Server Name.  Quitting...."
  wscript.quit
end if

Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "%windir%\notepad " & WScript.ScriptFullName, 1, True
WshShell.Run "ovconfchg -ns bbc.cb -set CLIENT_BIND_ADDR " & ipaddress, 1, True
WshShell.Run "confchg -ns bbc.http -set CLIENT_BIND_ADDR  " & ipaddress, 1, True
WshShell.Run "ovc -kill", 1, True
WshShell.Run "ovc -start", 1, True
WshShell.Run "ovconfchg -ns bbc.http -set PROXY ""esos-sdn:9077-(" & server & ")+(*)""", 1, True

Open in new window


~bp
0
 
Steve KnightIT ConsultancyCommented:
Thanks for following up Bill, didnt see those previous two author comments somehow...

i see you're chasing up various old Q's ..... Hows the points total :-)
0
 
Bill PrewCommented:
Under 10k now...

~bp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.