CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2003
    Location
    Israel
    Posts
    40

    Parameters with execution.

    if anyone knows how to make an exe file that gets parameters in execution...

    like:

    arj *.* /w /x ....

    or:

    FileName.exe /Parameter1 /Parameter2

    ????

    please help me.

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    Create a module with a Public Sub Main(args() as string) procedure and set it up as the startup procecure, it can accept the arguements.

  3. #3
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878
    Code:
    Imports System.Diagnostics.Process
    Public Class Form1
        Inherits System.Windows.Forms.Form
    
    #Region " Windows Form Designer generated code "
    #End Region
        Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim proc As New Process()
    
            proc.StartInfo.FileName = "c:\windows\notepad.exe"
            proc.StartInfo.Arguments = "c:\temp\vb.txt"
            proc.Start()
        End Sub
    End Class
    Iouri Boutchkine
    [email protected]

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