Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Raise alert

Posted on 1999-07-07
Medium Priority
Last Modified: 2010-05-02
How would you raise an alert from a VB program that a Batch file program can obtain?

A batch file executes a VB pgm and depending on user response, the VB pgm needs to tell batch pgm to "go" or "stop". Aside from writing to a msg/flag file, is there some slick way (API, etc.) to raise an alert or set a condition code that the batch file can easily obtain? An example if you've got it.

Question by:jalymo
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
  • 3
  • 3
LVL 20

Expert Comment

ID: 1522460
Declare this
Private Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

Then to pass the value to the batch file in your program use
ExitProcess 1&
In this case it passes a 1
To pass a 100
ExitProcess 100&


Author Comment

ID: 1522461
hes --

Do you know how the batch file program would obtain this exitprocess value?

LVL 20

Expert Comment

ID: 1522462
Let's say you want your program to return 2 values 100 & 50
100 is your go 50 is our quit. In your batch file do the following:
@echo off
start /w yourprogram.exe
if errorlevel 100 goto 100
if errorlevel 50 goto done
your code that you want to execute for the go
goto done
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 1522463
hes --


send the "proposed answer" and I'll dispatch the "accept"
LVL 20

Accepted Solution

hes earned 200 total points
ID: 1522464
See above

Author Comment

ID: 1522465

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

715 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