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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command function and shells 1

Status
Not open for further replies.

cyberbiker

Programmer
Mar 16, 2001
431
US
I am working on a very goofy program here. So bear with me as I ask another wierd question.
I need to have one program call another, which I believe is done from the shell.
That seems to be pretty straight forward. When that program stars executing, I need to find the command line of the program which called it.
Does command function return the 1st or second?
Ie:
The program ABC.exe is called by the command line C:\WhereAmI\ABC.exe. The path for the called program
is C:\WhatDoIDoNow\XYZ.exe.
If I call the command function as soon as XYZ.exe starts, which path does it return?
I am also having difficulties debugging this, Mostly shell does not like it when I ty to call the *.vbp unless I compile it first so I can not seem to step through both programs. I can probably work out the bugs seperately, but if any body knows a simple solution to that I would also appreciate it
Terry Terry (cyberbiker)
 
The Command function returns only the argument part of the command line, the part that appear after the name of the application.
So the path of the application isn't retuned.
To make this type of tests you can place some msgbox on your exe that shows the variables you want to chack (As we did years ago when debugging tools wasn't available).
If you want to retrieve the path of the caller programs you can pass it as a parameter:
Example:
C:\WhatDoIDoNow\XYZ.exe C:\WhereAmI Stevie B. Gibson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top