Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 cmd lime param help ( c:\myprog.exe /? )

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I would like to be able to return command line paramater switch help from my VB6 exe (

eg.
by typing at the command prompt:
c:\myprog.exe /? [enter]

command window output /1 (source folder)
/2 (destination folder)

)
Can someone show me how to do it, without a windows message box popping up. I searched forever in MSDN without any luck.
 
How about something like this?

Code:
Option Explicit

Sub form_load()
    Dim bDebug As Boolean
    Dim a_strArgs() As String
    Dim strHostName As String, strLogFile As String
    Dim intRemotePort As Integer
   
    Dim i As Integer
   
    a_strArgs = Split(Command$, " ")
    For i = LBound(a_strArgs) To UBound(a_strArgs)
        '/remoteport=623 /hostname=localhost /debug /logfile=c:\log.txt
        If Left$(LCase(a_strArgs(i)), 12) = "/remoteport=" Then
            intRemotePort = Mid$(a_strArgs(i), 13)
        ElseIf Left$(LCase(a_strArgs(i)), 10) = "/hostname=" Then
            strHostName = Mid$(a_strArgs(i), 11)
        ElseIf LCase(a_strArgs(i)) = "/debug" Then
            bDebug = True
        ElseIf Left$(LCase(a_strArgs(i)), 9) = "/logfile=" Then
            strLogFile = Mid$(a_strArgs(i), 10)
        End If
    Next i
    
End Sub
Snaggs
tribesaddict@swbell.net
Life can only be understood backwards; but it must be lived forwards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top