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

VB exe via a batch file

Status
Not open for further replies.

sxs90

Programmer
Oct 3, 1999
10
US
Is there a way to pass a parameter to a vb exe from a shell command / batch file and have the return value show up on the next line of the same command prompt screen that launched the VB exe....<br>
<br>
<br>
for example, VB code is:<br>
<br>
varResult = var1 + var2<br>
<br>
When the exe is launched via shell command, the next line should<br>
ask the use tio input a value for var1 followed by asking the user to input value for var2<br>
Displaying the result in the shell window.<br>
Thanks<br>
<br>

 
<br>
I haven't done this, but you might be able to use the Win32 file functions to write to the stdio file (a reserved file handle). Look in the MSDN for samples on doing this.<br>
<br>
Chip H.<br>

 
Check the VB 5&6 thread &quot;How to display command line output&quot; dated August 26. The thread fizzled without a good answer but the posts might give you some ideas.
 
If I follow you right.<br>
Use a small data file to store a value say &quot;var1&quot; in your case.<br>
Then the first program can read that data file in a timer event every second or so.<br>
So both programs are reading the same data file or writing to it. But each program has to open it read something then close it or the other program will get a error.<br>
you can pass values to any number of programs using this method.<br>
If the data is complicated lots of values use an Access .MDB which is better suited for this.<br>
<br>
Hope this helps<br>
DougP<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top