troubleshooting Question

How to convert batch file to vbscript

Avatar of janis101
janis101 asked on
Windows Server 2003VB ScriptWindows Server 2008
12 Comments1 Solution3015 ViewsLast Modified:
Guys,

Can anyone help me how to convert batch file to vbscript as we are using vbscript for automation.

attaching batch code

ovc -kill
cd C:\Program Files\HP OpenView\lbin\eaagt
ren opcmsgi.exe opcmsgiORIG.exe
ren opcmsga.exe opcmsgaORIG.exe
cd\
cd C:\Program Files\HP OpenView\bin
ren opcmsg.exe opcmsgORIG.exe
cd\
copy /Y " \c:\Hotfix\opcmsgi.exe"  "C:\Program Files\HP OpenView\lbin\eaagt\opcmsgi.exe" 
copy /Y " \c:\Hotfix\opcmsga.exe"  "C:\Program Files\HP OpenView\lbin\eaagt\opcmsga.exe"
copy /Y "\c:\Hotfix\opcmsg.exe"   "C:\Program Files\HP OpenView\bin\opcmsg.exe"
ovc -start
ovc -kill
cd C:\Program Files\HP OpenView\bin
ovpacmd stop alarm
cd\
cd C:\Program Files\HP OpenView\support
ovtrcadm -srvshutdown
net stop HPOvTrcSvc
cd\
cd C:\Program Files\HP OpenView\bin
ren OvXpl.dll OvXpl.dllorig
ren ovbbccb.exe ovbbccborig1.exe
ren OvBbc.dll OvBbc.dll.orig
copy "\c:\Hotfix\OvXpl.dll"   "C:\Program Files\HP OpenView\bin\OvXpl.dll"
copy "\c:\Hotfix\ovbbccb.exe"   "C:\Program Files\HP OpenView\bin\ovbbccb.exe"
copy "\c:\ Hotfix\OvBbc.dll"   "C:\Program Files\HP OpenView\bin\OvBbc.dll"
ovpacmd start alarm
net start HPOvTrcSvc
ovc -start
ovc -status

Manual Steps:

1.      Stop the agent:

c:\> opcagt -stop
2.      Copy and rename original files:
•      C:\Program Files\HP OpenView\lbin\eaagt\opcmsgi.exe to opcmsgiORIG.exe
•      C:\Program Files\HP OpenView\lbin\eaagt\opcmsga.exe to opcmsgaORIG.exe
•      C:\Program Files\HP OpenView\bin\opcmsg.exe to opcmsgORIG.exe

3.      Copy hotfixes  to their correct locations:
•      opcmsgi.exe to C:\Program Files\HP OpenView\lbin\eaagt\opcmsgi.exe
•      opcmsga.exe to C:\Program Files\HP OpenView\lbin\eaagt\opcmsga.exe
•      opcmsg.exe to C:\Program Files\HP OpenView\bin\ \opcmsg.exe

4.      Start the agent:

c:\> opcagt –start

Stop the agent :
C:\> ovc –kill
1.      Stop the PA alarm components:
         C:\Program Files\HP OpenView\bin> ovpacmd stop alarm

2.        Stop the OV Trace service:

C:\Program Files\HP OpenView\support> ovtrcadm -srvshutdown
C:\ Program Files\HP OpenView\support> net stop HPOvTrcSvc

3.      Copy and rename original files in C:\Program Files\HP OpenView\bin\win64\ :
a.      OvXpl.dll  to OvXpl.dll.orig

b.      ovbbccb.exe to ovbbccb.exe.orig
c.      OvBbc.dll to OvBbc.dll.orig
Copy hotfix files to C:\Program Files\HP OpenView\bin\ win64\

a.  OvXpl.dll
b. ovbbccb.exe
c. OvBbc.dll
4.         Start the PA services:

  C:\> ovpacmd start alarm
5.         Start the OV Trace service:

                      C:\> net start HPOvTrcSvc

6.       Start the  agent
         C:\> ovc -start
7.       Check the agent status and make sure all the processes are running:
   C:\> ovc –status
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros