?
Solved

Return A Value Thru EXE

Posted on 2003-03-16
6
Medium Priority
?
176 Views
Last Modified: 2010-05-01
All,

   Now the req is like this... I have to create an exe in VB, which when executed thru DOS (a batch file) the result of the VB must get stored in DOS variable....

  EX: if the exe returns say 20030316
     

    if I have said %1 = c:\Proj1.exe

   then echo %1 should return 20030316

Please Help
Thanks
0
Comment
Question by:ananthu
[X]
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
6 Comments
 
LVL 1

Expert Comment

by:robertlees
ID: 8149355
I've not tried it, but I don't think you can do this. VB programs must operate in the Windows environment. DOS doesn't know how to locate and link routines in DLLs, and VB programs rely heavily on DLLs.
0
 
LVL 1

Expert Comment

by:hmadhur
ID: 8149727
First of all you cannot run a VB application in DOS. Try VC++ by statically linking MFC dlls. Then you can execute it in Dos env also. VB as far as I know, can't be done. But anyways I'll give it a try.

Good Luck.
0
 

Author Comment

by:ananthu
ID: 8149834
I am not running it in a DOS environment. I am running it in Windowns Environment but thru DOS....
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
Chimo earned 60 total points
ID: 8185171
Use the api ExitProcess to terminate your application

Public Declare Sub ExitProcess Lib "kernel32" (ByVal uExitCode As Long)

To return 30316, you only have to do

Call ExitProcess(30316)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/exitprocess.asp

0
 

Expert Comment

by:CleanupPing
ID: 8532250
Hi ananthu,
This old question (QID 20552935) needs to be finalized -- accept an answer, split points, or get a refund.  Please see http://www.cityofangels.com/Experts/Closing.htm for information and options.
0
 
LVL 6

Expert Comment

by:GPrentice00
ID: 8956466
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

-->Accept Chimo's comments as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

GPrentice00
EE Cleanup Volunteer
0

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 6 hours left to enroll

741 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