Solved

Calling Windows application from .vb scripts

Posted on 2014-03-13
4
194 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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
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…
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.

911 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

18 Experts available now in Live!

Get 1:1 Help Now