467,874 Members | 1,730 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,874 developers. It's quick & easy.

parameter passing to EXE file and reading the parameter inside the EXE

How to make a EXE file to accept the parameter values passed from the command line and how to read back the passed parameter values

help required urgently
Nov 17 '06 #1
  • viewed: 3791
Share:
5 Replies
Expert 8TB
How to make a EXE file to accept the parameter values passed from the command line and how to read back the passed parameter values

help required urgently
Try looking at the value in Command$
Nov 17 '06 #2
100+
Try looking at the value in Command$
hi

or

Argument=Command()
Nov 17 '06 #3
hi

or

Argument=Command()
can u provide any live working sample please
Nov 17 '06 #4
100+
can u provide any live working sample please

hi there

place following in your Form_Load()
call the Form : Form1
place a textbox (select multiline=true) calles Text1
drag a textfile on top of the program's icon (after compiling an exe)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_Load()
  3. On Error GoTo fail
  4. 'see if the program was opened with an argument...
  5. FileName = Command()
  6. If Not FileName = vbNullString Then
  7.     Open FileName For Input As #1
  8.         Line Input #1, p
  9.         Form1.Text1.Text = p
  10.         While Not EOF(1)
  11.         Line Input #1, p
  12.         Form1.Text1.Text = Form1.Text1.Text & vbCrLf & p
  13.         Wend
  14.     Close #1
  15. End If
  16. End Sub
  17.  
  18.  
Nov 17 '06 #5
100+
hi there

place following in your Form_Load()
call the Form : Form1
place a textbox (select multiline=true) calles Text1
drag a textfile on top of the program's icon (after compiling an exe)

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form_Load()
  3. On Error GoTo fail
  4. 'see if the program was opened with an argument...
  5. FileName = Command()
  6. If Not FileName = vbNullString Then
  7.     Open FileName For Input As #1
  8.         Line Input #1, p
  9.         Form1.Text1.Text = p
  10.         While Not EOF(1)
  11.         Line Input #1, p
  12.         Form1.Text1.Text = Form1.Text1.Text & vbCrLf & p
  13.         Wend
  14.     Close #1
  15. End If
  16. End Sub
  17.  
  18.  
need to put

Fail:

just before End Sub !
Nov 17 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

8 posts views Thread by Dave Veeneman | last post: by
reply views Thread by KK | last post: by
16 posts views Thread by Theo R. | last post: by
9 posts views Thread by Eric Lilja | last post: by
13 posts views Thread by frakie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.