Client Automation Enterprise Infrastructure (Radia) Forum
Showing results for 
Search instead for 
Do you mean 

executing nvdkit command in vbscript

po1
Occasional Visitor

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

3 REPLIES
Highlighted
Trusted Contributor

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

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

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