Solved

calling a Vbscript from a Vbscript

Posted on 2011-02-17
6
436 Views
Last Modified: 2012-06-22
i am getting an error when using the code below that says "Cannot use parentheses when calling a sub".


what is the correct way to call a new vbscript from an existing vbscript?
Dim oShell, a 
oShell = CreateObject("Wscript.Shell") 
a = "C:\users\administrator\desktop\test.vbs" 
oShell.run(a, 3, True)

Open in new window

0
Comment
Question by:ob1_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
6 Comments
 
LVL 33

Expert Comment

by:jppinto
ID: 34918820
0
 
LVL 6

Author Comment

by:ob1_
ID: 34918850
not sure that will work. my main script is a VBS file not a WSF file and i am not trying to pull a function from another script but pass some variables onto the 2nd script via arguments and then execute the whole thing.
0
 
LVL 52

Expert Comment

by:Huseyin KAHRAMAN
ID: 34918952
try:

Dim oShell, a
oShell = CreateObject("Wscript.Shell")
a = "cscipt C:\users\administrator\desktop\test.vbs"
oShell.run(a, 3, True)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Author Comment

by:ob1_
ID: 34919091
i still get "cannot use parentheses when calling a sub" on the oShell.run(a, 3, True) line....
0
 
LVL 6

Accepted Solution

by:
ob1_ earned 0 total points
ID: 34919152
0
 
LVL 6

Author Closing Comment

by:ob1_
ID: 34949758
found post with answer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Well hello again!  Glad to see you've made it this far without giving up.  In this, the fourth installment of my popular series, I'm going to cover functions and subroutines, what they are, and why they are useful.  Just in case you stumbled onto th…
Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

697 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