Simple Program In Vb6.0
I want to run a batch program(.bat) through a Visual Basic 6.0 application and also want to print the output of the batch program(.bat) in the Visual Basic 6.0 application. I want to execute the dir command in the batch file so that VB6.0 application can print the output in a text box.
VB6.0 code:
first.bat:
In the above example 'first.bat' is batch file and containing the 'dir c:' command. Now VB6.0 app will run the first.bat and show the output of the 'dir c:' command in a text box.
Object Oriented Programming Lab Visual Basic Projects with source Code Download Visual Basic Projects with source Code, reports and abstracts.You can use these projects by modifying according to your need of functionality.Visual basic projects basically use oracle database for project implementation.
Please also tell me that I can achieve this requirement means can VB6.0 application regain the control from batch program(.bat)?
Please help me with this.
3 Answers
Your example is not a batch file, but if all you want to do is display the results of a command prompt's dir c:
command in a textbox, then the following should work:
Disclaimer: The following is 'Air Code' and not tested for syntax
There are several variations and alternative ways to accomplish this, this is just a quick-and-dirty solution example.
Lots of simple ways to skin this cat, for example:
Following is solution which worked for me:
I got this solution from the following link:Solution Link