VB Script to run an exe

Posted on 2011-10-19
Last Modified: 2012-10-15
I need to create a vb script that will check for the existence of a file and if it is not found, run the install.
Question by:kim1109
    1 Comment
    LVL 7

    Accepted Solution

    try this vbs code
    dim objFSO 
    dim strFile
    dim strSetup
    Dim shell
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    if not  objFSO.FileExists(strFile) then
        Set shell = CreateObject("WScript.Shell")
        shell.Run Chr(34) & strSetup & Chr(34), 1, false
        Set shell = Nothing
    end if

    Open in new window


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
    Introduction During my participation as a VBScript contributor at Experts Exchange, one of the most common questions I come across is this: "I have a script that runs against only one computer. How can I make it run against a list of computers in …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    755 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

    19 Experts available now in Live!

    Get 1:1 Help Now