Re: executing nvdkit command in vbscript (282 Views)
Reply
po1
Occasional Visitor
Posts: 3
Registered: ‎12-05-2013
Message 1 of 4 (315 Views)

executing nvdkit command in vbscript

Hi, Guys.

 

I am trying to create a script to check the compressed size in the CSDB.  Executing the command below in the command prompt is fine.

 

nvdkit tp -host <servername> db/export PRIMARY.PATCHMGR.FILE.E901142D8EC0_8B97BBBD "ZCMPSIZE"

 

When I tried putting it inside the vbsript (below), it doesn't work.

 

Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")

oShell.run "cmd /c" & "nvdkit.exe " & "tp " & "-host " & "<servername>" & "nvdkit tp db/export PRIMARY.PATCHMGR.FILE.E901142D8EC0_8B97BBBD "ZCMPSIZE""

Set oShell = Nothing

 

I'm a newbie in scripting as well as manipulating radia properties via nvdkit. I can appreciate if someone can teach me how to do it, please?

 

Thanks!

Pau1

Highlighted
Trusted Contributor
Posts: 156
Registered: ‎03-04-2010
Message 2 of 4 (282 Views)

Re: executing nvdkit command in vbscript

Hi,

 

While launching from vbs can also work, you can write the nvdkit command in a batch file like :

 

start  "" "C:/nvdkit.exe" tp -host localhost -user admin -pass secret db/export PRIMARY.SOFTWARE.ZSERVICE.*

 

Later call this batch file (say TEST.bat) from a vbs :

 

Set oShell = CreateObject("WSCript.shell")

 

sCmd = """C:\TEST.bat"""

 

oShell.Run sCmd, 0, False

----------------------------------------

 

Thanks,

Praveen

po1
Occasional Visitor
Posts: 3
Registered: ‎12-05-2013
Message 3 of 4 (267 Views)

Re: executing nvdkit command in vbscript

Thanks Praveen. I am just thinking on how to pull list of lets say 10 servers from the batch file. Pardon my noob question on the scripting part as I am starting to learn from this simple activity. The script that I will create will be executed from a jumphost and will check the necessary attributes from CSDB.

 

I will try first your suggestion and will post feedback once completed.

 

Thank you.

Po1

po1
Occasional Visitor
Posts: 3
Registered: ‎12-05-2013
Message 4 of 4 (248 Views)

Re: executing nvdkit command in vbscript

Hello, Praveen.

 

I wrote this script and now my concern is I want to write the output of the command to the notepad so that I can read on it for reference.

 

Dim oShell, strCommandLine, disp, exitcode
Set oShell = WScript.CreateObject ("WScript.Shell")


oShell.run "cmd /c" & "nvdkit.exe tp -host <hostname> db/export PRIMARY.PATCHMGR.FILE.E901142D8EC0_8B97BBBD ZCMPSIZE"


oShell.Run disp, true

exitcode = oShell.Run (disp,true)

Set oShell = Nothing

 

Can you show how to write the output to a text file?

 

Thank you.

p01

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.