Link to home
Start Free TrialLog in
Avatar of sony1464
sony1464

asked on

parsing the command line arguments

How do you read values passed as a command line argument in vb6 applications. the application would be called like shown below. I would like to get the three arguments that are passed with the exe. How do i do that vb 6. thanks in advance.

C:\parser.exe JU1991020005 940604707218.txt  940604707218.idx
Avatar of [ fanpages ]
[ fanpages ]

Hi,

Query the Command$ variable in your VB code.

In the above example, it will contain "JU1991020005 940604707218.txt  940604707218.idx".

BFN,

fp.
I think you can get by using the command function.

sub frmmain_load()
   frmmain.text1 = command
end sub
ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sony1464

ASKER


i tried hes's example and it worked great .... now how do i get the filename without the extension from the second argument and save it in the application diresctory as filaname.doc...i really appreciate such a quick reponse....

for the above example i want a file called 940604707218.doc to be created in the application directory.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial