Solved

VBScript - WaitForSingleObject

Posted on 2007-11-20
1
1,509 Views
Last Modified: 2012-05-05
Hi,

I am looking for a working example in VBScript to use the API waitforsingleobject.  I have working code for this in VB6 but need this for VBScript as well.  

Thanks.
0
Comment
Question by:1500orion
1 Comment
 
LVL 38

Accepted Solution

by:
PaulHews earned 500 total points
ID: 20320656
You cannot call the API from vbscript.  However, you can shell and wait for a process to return:


http://msdn2.microsoft.com/en-us/library/d5fk67ky.aspx
Set WshShell = WScript.CreateObject("WScript.Shell")
 

Return = WshShell.Run("notepad " & WScript.ScriptFullName, 1, true)  'True parameter specifies to wait for return

Open in new window

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

707 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

17 Experts available now in Live!

Get 1:1 Help Now