Solved

Calling Windows application from .vb scripts

Posted on 2014-03-13
4
198 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 53

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 Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
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.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

807 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