Results 1 to 5 of 5

Thread: Runing programs to do different things (i.e. . C:\windows\Explorer.exe C:\windows\Xer

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Lightbulb

    How Can I run a program with
    a word at the end to make it do
    something different??

    Thanks...
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744

    Lightbulb

    You can try something like this:
    Code:
    Call Shell("Notepad C:\MyFile.txt", vbNormalFocus)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Sorry..

    I didnt say What I wanted clear enough.
    I need to be able to make my program
    run differently when i want it too.
    Like type C:\ClientAlert\Alert.exe "Check"
    and it will check something for me.

    Can you give me the code to do this??
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  4. #4
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Ohh I see, you want to pass arguments to your program??? If yes, then it is very easy to do.

    You would have to use Command function which brings back the argument list:

    Code:
    Private Sub Form_Load()
        Dim strCommand As String
        
        
        strCommand = Command
        
        If strCommand = "" Then
            MsgBox "You didn't pass any arguments."
            Exit Sub
        End If
        
        MsgBox "You passed: " & strCommand
    End Sub
    Compile your program and run it from the command line:

    YourProgram.exe Check

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184

    Red face

    Thankyou!
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


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