Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WShell.run problems 1

Status
Not open for further replies.

bertieuk

IS-IT--Management
Jun 1, 2004
175
I am writing a script to automatically run a set of Legato external commands

I am using:

retcode = Wshell.run ("%comspec% /C nsrmm -s""backup-server1"" -d -S" & idlist(0) "/" & idList(1)", 1, TRUE)

The idlist array holds a pair of id numbers. Therefore idlist is a variable. I am having trouble with the syntax and mixing the command with variables. I am using two double quotes to delimit the double quote mark.


I am trying to represent running the equivilent command line:

nsrmm -s"backup-server1" -d -S 1234567/6543216

Thanks

Si
 
Hello bertieuk,

It is like this.
retcode = Wshell.run ("%comspec% /C nsrmm -s""backup-server1"" -d -S[COLOR=red yellow] [/color]" & idlist(0) [COLOR=red yellow]&[/color] "/" & idList(1)[COLOR=red yellow],[/color] 1, TRUE)

regards - tsuji
 
Would there be any benefit using the Exec method of WshShell and get rid of %comspec%.

ie objShell.Exec "nsrmm -s""backup-server1"" -d -S" & idlist(0) & "/" & idList(1)


Would this work?

Si

 
bertieuk,

If the .run line works for you, no reason to use .exec. It is not a superior/inferior competition relation between them. If you use .exec behaving like .run with true bWaitOnReturn, then you have to control the status property of the object returned by the .exec. (Your line is not good enough. Check out the documentation.)

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top