?
Solved

How to execute command through VBScript?

Posted on 2011-10-16
9
Medium Priority
?
430 Views
Last Modified: 2014-05-15
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.

0
Comment
Question by:jashir101
  • 3
  • 2
  • 2
7 Comments
 
LVL 43

Accepted Solution

by:
Steve Knight earned 1000 total points
ID: 36976101
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 36976984
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
 

Author Comment

by:jashir101
ID: 36980156
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
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 

Author Comment

by:jashir101
ID: 36980170
NB: Im executing script on windows server 2003 and 2008.
0
 
LVL 59

Assisted Solution

by:Bill Prew
Bill Prew earned 1000 total points
ID: 37123481
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
 
LVL 43

Expert Comment

by:Steve Knight
ID: 37123666
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
 
LVL 59

Expert Comment

by:Bill Prew
ID: 37124695
Under 10k now...

~bp
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question