CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    How to build a commandline application in VB6.0

    I want to implement some code in VB6.0 application and make it as commandline exe. So that I can execute it from any shell Proc command. And also how can I have the commandline arguments with in VB Application.

    Please anybody help me how to do that.

    Thanks
    bdharmap
    Last edited by bdharmap; August 10th, 2004 at 09:41 AM.

  2. #2
    Join Date
    Jun 2002
    Location
    Clane, Ireland
    Posts
    766
    If I understand you correctly, what you do, is create a standard project, include a module and put all your code in the module. The properties of the project state that you start with SUB MAIN, the last thing SUB MAIN does is issue the END command.

    This will not allow for user interaction though.

    I have used this technique to call a VB progam from a dos .BAT file, to translate the contents of a file, before FTP'ing it to another location.

    HTH
    JP

    Please remember to rate all postings.

  3. #3
    Join Date
    Nov 2002
    Location
    Baby Land
    Posts
    646
    Just to add some more infos, you can use the Command$ function to retrieve the command line arguments

  4. #4
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Lightbulb Console Applications

    If you wish to develop a console application, then this is the place where u will find some info..

    Console Apps


    Cheers

  5. #5
    Join Date
    Nov 2002
    Posts
    82
    Hallo bdharmap,

    you wrote
    Code:
    I want to implement some code in VB6.0 application and make it as commandline exe. So that I can execute it from any shell Proc command.
    If I have really understood, you want to add some command line parameters to you application in the way that this (your application) reacts on these parameters.

    You need there for a command line parser. You can use the function Command. See here for an example, and here for the documentation.

    I add some code to introduce, if you are interested to write your application that have to emulate his own shell or to link to the system shell or to load several forms as a command option.
    Attached Files Attached Files
    james

  6. #6
    Join Date
    Jul 2004
    Posts
    5
    Thanks all for your help.

    It worked using Command function and reading the args by parsing.

    Thanks,
    bdharmap

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

Featured