Solved

VB EXE

Posted on 1998-12-17
5
282 Views
Last Modified: 2010-05-03
I have an exe with 2 bas  modules in a project and i need to pass command line arguments to the exe
how can i do this ?
0
Comment
Question by:sujmags
5 Comments
 
LVL 2

Expert Comment

by:polygon
ID: 1451118
I can's exactly understand your question, but if you need to know the command parameters of your program, use Command function. And if you want to specify some parameters for the debugging of your program, use your projects properties to specify such.

BTW, while debugging you can never get the same parameters as when running an exe. This is because to run your project in a debug session, VB specifies it as a parameter to some exe.
0
 
LVL 1

Expert Comment

by:OeilNoir
ID: 1451119
i don't understand well the question either.. but if you mean you need to call an exe from your app and you need to pass parameters to it, then
simply use the "shell" command and write the prametres in it

Exemple :
shell "c:\test.exe /param1"
or
shell "c:\test.exe "  & strParam
0
 

Author Comment

by:sujmags
ID: 1451120
I'll make the question more clear,
this is the st that i have within my sub main ()
I have an exe which comprises of sub main and one more module , i need to pass commandline args for this exe.

submain has a st. like this , these values are passed directly but instead these have to be read from command line.
(given below is the sample module)

gbRetState = CheckParameters("c:\a.rpt", "12-Dec-98", "RPT01", "JOB01")

Public Sub Main()
   Dim RetVal As Boolean
   
 
 
 'Check parameters
   gbRetState = CheckParameters("c:\a.rpt", "12-Dec-98", "RPT01", "JOB01")
    If gbRetState = False Then
        Call ErrorFileUpdate("Process Status: Invalid parameter")
        Screen.MousePointer = gbArrow
        Exit Sub
    End If
   
 End Sub
0
 
LVL 1

Accepted Solution

by:
jeffcameron earned 10 total points
ID: 1451121
use the Command() function in VB to get parameters from the command line
0
 

Author Comment

by:sujmags
ID: 1451122
Thanks jeff, really appreciate the timely response
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

910 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

21 Experts available now in Live!

Get 1:1 Help Now