Results 1 to 7 of 7

Thread: [RESOLVED] command line argument

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Resolved [RESOLVED] command line argument

    I have specified command line argument in project properties this argument is mandatory to specify for my app license manager and this app is developed for SAP which also need to specify connection string in command line argument although I have tried to hardcode the connection string but my app stop working.
    Can I change command line in code? Any help please?

  2. #2
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: command line argument

    VB Code:
    1. MsgBox [U]Command$[/U]

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: command line argument

    thanks for rpl jeroen79

    i know how to access "Command" i want to know how can i specify 2 command line argument .... or is there any other way for my problem?

  4. #4
    Frenzied Member
    Join Date
    Oct 2003
    Posts
    1,301

    Re: command line argument

    Make sure that there is something that separates the arguments (like a space or a slash) and then split the command string on this separator.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: command line argument

    you can get the value of command at any time, if you have more than one argument in command you will have to split it or otherwise process the string
    example
    VB Code:
    1. Text1 = Split(Command, " ")(2)
    will put the third argument into the text box
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  6. #6
    Frenzied Member cssriraman's Avatar
    Join Date
    Jun 2005
    Posts
    1,465

    Re: command line argument

    My suggestion is to use / or |. Because some times we might have space in our commandline.

    For example, if you are passing a file path with other arguments, like

    YourApp.exe "C:\Program Files\Test.exe" BlankMain

    In this case you might face problem if you use space as a delimiter.
    CS

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2005
    Posts
    120

    Re: command line argument

    thanks for rpl
    problem solved

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