Solved

Calling Windows application from .vb scripts

Posted on 2014-03-13
4
191 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 51

Accepted Solution

by:
Bill Prew earned 500 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! https://www.google.com/about/careers/students/guide-to-technical-development.html How to Know You are Making a Difference at EE In August, 2013, one …
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
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.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

760 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now