Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calling Windows application from .vb scripts

Posted on 2014-03-13
4
Medium Priority
?
206 Views
Last Modified: 2014-05-08
Hi I am creating windows application which is doing some synchronization,But I want to run this automatically everyday at 12AM,I have already some .vb scripts which automatically take database backup,Can I call windows application also using that vb scripts.Please help me asap.
0
Comment
Question by:Sudhanshum
  • 2
4 Comments
 

Expert Comment

by:gfk76
ID: 39928879
Dim MyShell
Dim shell_cmd

shell_cmd = "c:\folder\Application.exe"
set MyShell = CreateObject("WScript.Shell")
MyShell.Run shell_cmd, 1, 1
0
 

Author Comment

by:Sudhanshum
ID: 39936083
Hi Thanks for reply But I have few question.

a)I got shell_cmd = "c:\folder\Application.exe"
here we are giving our exe path.

b)set MyShell = CreateObject("WScript.Shell")
I am not sure what WScript.Shell mean

c)MyShell.Run shell_cmd, 1, 1
What shell_cmd mean here
0
 

Author Comment

by:Sudhanshum
ID: 39938828
Please help me asap.
0
 
LVL 59

Accepted Solution

by:
Bill Prew earned 2000 total points
ID: 39977903
To try and help answer your questions,

(a) notice that you are creating a variable named shell_cmd with the path to the EXE you want to run.  This variable is then reference in (c) to actually execute it.

(b) This creates (or 'instantiates') the Windows Shell object so that you can use it's methods.  One of those methods is Run, which you need to execrte an external EXE program from VBS.

http://msdn.microsoft.com/en-us/library/d5fk67ky%28v=vs.84%29.aspx

(c) This line uses the Run method of the shell, passing it the variable shell_cmd that you defined in (a) with the name of the EXE you want to execute.

~bp
0

Featured Post

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!

Question has a verified solution.

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

Using Quotation Marks in PHP This question (http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_28217211.html) seems to come up a lot for developers who are new to PHP.  And it got me thinking, "How can we explain the rule…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This video teaches users how to migrate an existing Wordpress website to a new domain.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Suggested Courses

972 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