473,395 Members | 1,422 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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
5 4055
Killer42
8,435 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
albertw
267 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
albertw
267 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
albertw
267 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

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

Similar topics

8
by: Dave Veeneman | last post by:
Can I pass a method pass one of its out parameters to another method? C# is telling me I can't. Let's say I have two methods, FooManager and FooWorker. FooManager is part of a class that acts as...
0
by: KK | last post by:
Hi MCPP gurus' I have a small problem in parameter passing.This is my situation namespace Abc { public __gc class ClassAbc { public: String* Hello(String* str) {
0
by: Richard Buckshaw | last post by:
Mimick the older C/ pascal dll parameter passing convention? - VB Class Mod? Hello, I have been attempting to write a VB class that would expose its stuff to an older (ok, legacy application)...
1
by: Néstor Sánchez A. | last post by:
Hi, is there a way, maybe using reflection, to use a generic class passing the type parameter dynamicly (not kwnowing the exact type at compile time)? I tried the next example, but doesn't work: ...
1
by: vijay.gandhi | last post by:
Hello, I have created a function in C++/CLI which was exported as a .DLL to be used in VB .NET. I have been having some problems (I think it has to do with the right syntax) with parameter...
16
by: Theo R. | last post by:
Hi all, Does the C99 Standard explicitly mention the need for a stack for passing arguments or Is this platform specific? As an example, the ARM9 processor recommends Core Registers R0-R3 be...
1
by: jadeite100 | last post by:
Hi: I am having problem passing an xsl param variable as a parameter to a javascript function inside an xsl styelsheet. Here is my xsl stylesheet. I am trying to pass a variable called...
9
by: Eric Lilja | last post by:
Hi! I have a program with a class that needs to be able to write itself to a file in clear text format. The file has two integers and vector of struct objects. The struct has a string that can...
13
by: frakie | last post by:
Hi 'body, I'm experiencing difficulties on parameter passing. I wrote a library in last months, and now it crashes few times in a month because of errors in parameter passing: using gdb on the...
1
by: tarunkhatri | last post by:
Hi, I want to pass the parameter of employee_id to a page. My code is working fine and passing parameter to page but the problem is rather then the current parameter. It passed the parameter which...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.