Solved

Calling Windows application from .vb scripts

Posted on 2014-03-13
4
204 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
[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
  • 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 56

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
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.

632 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