Solved

calling a Vbscript from a Vbscript

Posted on 2011-02-17
6
437 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 55

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
Independent Software Vendors: 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

Script to copy or move mouse-selected collection of files plus targets referenced by shortcuts (.lnk) The purpose of this article is to help illuminate the real challenges and options available (where they may exist) for utilizing simple scriptin…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

695 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