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

Run VB exe from command line

Status
Not open for further replies.

Neera

MIS
Nov 9, 2000
10
US
I need to run VB exe. The use wants to put it in a schedules where the input and output file will be passed as a parameter on the DOS line with run statement.

For example like this:

D:\>rriscrub9 [path\input table] [path\output table]


Can VB run this way??????????


TimLarkin (Programmer) Apr 2, 2001
You Betcha!
Run Line: C:\MyExe.exe C:\MyFile.txt D:\YourFile.txt
In your VB.exe


This morning I posted how to enter input/output file on the command line and the below is the answer.


Dim strInFile As String
Dim strOutFile As String
strInFile = Left(Command, InStr(Command, " ") - 1)
strOutFile = Mid(Command, InStr(Command, " ") + 1)

This did work but not the question is

The processing of the file is in a click event. Now because the input/output file is passed on the command line, I would like to process the file without the user interface. In which event the code should be to process the input file and create the output file??????/

 
Simply remove any forms from your code, add a standard module, and put the code in Public Sub Main. Then goto project properties window and set the startup mode to "Sub Main".
Mohammad Mehran Nikoo, MCP
mohmehran@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top