Results 1 to 10 of 10

Thread: how to retrieve the EXE Parameters from within the application

  1. #1

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    how to retrieve the EXE Parameters from within the application

    Dear all,

    i have a small exe project that does a small job. It is supposed to recieve a single paramter on runtime in order to tag the function.

    i will can it from within another program as following :

    VB Code:
    1. process.start("printinvoice.exe Username")

    from within the project PrintInvoice i need to get the value of the passed parameter at startup . How can i do this


    thx in advance

  2. #2

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: how to retrieve the EXE Parameters from within the application

    any answers ???

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to retrieve the EXE Parameters from within the application

    why doesn't anyone ever state what version of .NET they use

  4. #4

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: how to retrieve the EXE Parameters from within the application



    VS 2003 , Sorry kleinma no one is old enough for Doing mistakes

    rgds

  5. #5
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to retrieve the EXE Parameters from within the application

    In 2003, you can get your command line args using code like this

    VB Code:
    1. For Each S As String In Environment.GetCommandLineArgs()
    2.             MessageBox.Show(S)
    3.         Next
    keep in mind that in 2003, the first command line arg (argument at position 0 of the array) is always the full path to the exe that is running.

  6. #6

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: how to retrieve the EXE Parameters from within the application

    i am using VS2003

    Thank you very much for your kind answer

    i will give it a go now

  7. #7
    Lively Member
    Join Date
    Sep 2001
    Posts
    75

    Re: how to retrieve the EXE Parameters from within the application

    How do you get command line parameters in VB 6.0?
    We Jammin

  8. #8

    Thread Starter
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: how to retrieve the EXE Parameters from within the application

    i think u better post this question in the classical vb6 section

    Thank y ou

  9. #9
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: how to retrieve the EXE Parameters from within the application

    in VB6 you can see the command line arguments in a string with this
    VB Code:
    1. MsgBox Command$

    You have to parse it yourself.

  10. #10
    Lively Member
    Join Date
    Sep 2001
    Posts
    75

    Re: how to retrieve the EXE Parameters from within the application

    thanks. got that covered.
    We Jammin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width