+ Post New Thread
Results 1 to 3 of 3
Scripts Thread, VBscript help - test if process is there if so wait in Coding and Web Development; I am trying to install multiple bits of software using a vbscript The code I have to date is as ...
  1. #1

    Join Date
    Feb 2011
    Posts
    37
    Thank Post
    2
    Thanked 1 Time in 1 Post
    Rep Power
    0

    VBscript help - test if process is there if so wait

    I am trying to install multiple bits of software using a vbscript
    The code I have to date is as follows
    Option Explicit
    Dim strComputer, objNetwork, wshshell
    Dim PCname

    Set objNetwork = WScript.CreateObject("WScript.Network")
    PCname = objNetwork.ComputerName
    Set WshShell = WScript.CreateObject("WScript.Shell")

    WshShell.Run "msiexec /i \\server\share\programname\setup.msi /quiet /log \\server\share\" & PCname & "\programlogfile.txt"

    WScript.Quit

    This works fine, but I want to add more programs to it, but I am very new to vbscript and I am after very simple code to get it working

    What I would like is between each

    WshShell.Run "msiexec /i \\server\share\programname\setup.msi /quiet /log \\server\share\" & PCname & "\programlogfile.txt"

    I have a loop test that checks
    is msiexec.exe process is running
    if yes then wait 20000
    if not run next command

    Any ideas on a very simple solution?

    thank you

  2. Thanks to NETKILLER from:

    eejit (18th February 2011)

  3. #2

    Join Date
    Feb 2009
    Posts
    149
    Thank Post
    0
    Thanked 36 Times in 35 Posts
    Rep Power
    17
    if you add ',0,True' to the end of your WshShell.Run line the script will pause and wait until the program called by the line has quit before continuing on to the next line see Run Method (Windows Script Host) for more details.

  4. Thanks to HilcrRWise from:

    eejit (18th February 2011)

  5. #3

    Join Date
    Feb 2011
    Posts
    37
    Thank Post
    2
    Thanked 1 Time in 1 Post
    Rep Power
    0
    hey HilcrRWise

    thank you that has worked 8)

SHARE:
+ Post New Thread

Similar Threads

  1. [Video] Wait for it.......
    By mattx in forum Jokes/Interweb Things
    Replies: 0
    Last Post: 3rd December 2010, 09:14 AM
  2. VBScript help.
    By Sirbendy in forum Scripts
    Replies: 0
    Last Post: 6th October 2008, 01:24 PM
  3. VBSCRIPT
    By soze in forum How do you do....it?
    Replies: 2
    Last Post: 2nd June 2008, 05:44 PM
  4. What process....
    By Joanne in forum Windows
    Replies: 2
    Last Post: 31st March 2008, 05:01 PM
  5. VBScript
    By StewartKnight in forum Coding
    Replies: 5
    Last Post: 1st May 2007, 11:04 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •