Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. I am lost

I am lost

Scheduled Pinned Locked Moved Visual Basic
questiontoolshelp
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anonymous
    wrote on last edited by
    #1

    Hello, I would like to ask a very simple question. How can I open three or so programs using a script. I would like to pause about 30 seconds between them also. I talked to some friends at work and they said to use a vbscript, which is completely forien to me. Any help would be nice. Thanks. Shades

    N J 2 Replies Last reply
    0
    • A Anonymous

      Hello, I would like to ask a very simple question. How can I open three or so programs using a script. I would like to pause about 30 seconds between them also. I talked to some friends at work and they said to use a vbscript, which is completely forien to me. Any help would be nice. Thanks. Shades

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Use the ShellExecute and a Timer to control how often the functions are called. To call the ShellExecute API add this to a module:

      Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
      (ByVal hWnd As Long, ByVal lpOperation As String, _
      ByVal lpFile As String, ByVal lpParameters As String, _
      ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

      -Nick Parker

      1 Reply Last reply
      0
      • A Anonymous

        Hello, I would like to ask a very simple question. How can I open three or so programs using a script. I would like to pause about 30 seconds between them also. I talked to some friends at work and they said to use a vbscript, which is completely forien to me. Any help would be nice. Thanks. Shades

        J Offline
        J Offline
        John Kuhn
        wrote on last edited by
        #3

        Using VBScript and the Windows Scripting Host, it is possible to control a variety of things through "animation" of standard Windows applications. In your case, you could do something like the following: ' myScript.vbs -- Dim wshell Set wshell = WScript.CreateObject("WSCript.shell") wshell.run "calc.exe" WScript.Sleep 30000 wshell.run "notepad.exe" Enter the commands into a file using Notepad or your favorite editor and save it with a file extension of ".VBS". Double-click on the VBS file to execute the script. On 99% of desktops equipped with IE5.5+, this will function correctly. For more information, see MSDN > Platform SDK > Tools and Scripting > Windows Script Host.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups