Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

VB EXE

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
sujmags
Asked:
sujmags
1 Solution
 
polygonCommented:
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
 
OeilNoirCommented:
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
 
sujmagsAuthor Commented:
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
 
jeffcameronCommented:
use the Command() function in VB to get parameters from the command line
0
 
sujmagsAuthor Commented:
Thanks jeff, really appreciate the timely response
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now