VB.NET....sending command line arguments via process.start

Associate
Joined
27 Jan 2005
Posts
1,396
Location
S. Yorks
Hi,

I have written a program that opens a DOS program that sits waiting for a filename to be input, how do I pass the name of a file to the started process.

I asked the question elsewhere to be told that I could probaly do it by passing command line arguments to the started process - so how do I do this???

regards,

Matt
 
I have a visual way of selecting the file, common dialog, but the dos program requires the filename input inorder to process it.

regards,

Matt
 
Thanx for that...

The Dos program is a compiled fortran scientific program - with no manuals or anything.

Question if I include the arguments as you have shown does that act in a similar way to if I wrote a batch file as follows:

myprog.exe myfile.txt


Where myprog is the compiled fortran program and myfile.txt the text file requiring processing??

If this is how it works then, I have tried this and the fortran program doesn't accept arguments, it just loads and asks the user to input a filename.

regards,

Matt
 
It won't accept the command line arguements as typing the exe name then filename doesn't work it just starts the exe.

Is there any way of passing the filename then??

regards,

Matt

P.S. I have tried sendkeys all this does is pass a backslash to the dos program, no matter what you send.
 
Will give it another try tomorow...

I wasn't sure if sendkeys would only work with a prog designed to run under windows, obviously the prog I am running is designed to work only under Dos.

regards,

Matt
 
Have tried sendkeys again and all I get is the \ character displaying, if I send a filename where the file doesn't exist I get several \'s, which is weird.

I have received an email suggesting that in VB6 you could use API calls to o this, am new to VB so any help would e appreciated.

Anyone else got any better ideas?

regards,

Matt
 
Sendkeys in vb and vb.net just puts up a \ character.

It would be nice to rewrite the program in VB, but it is a scientific modelling program - hence complex.

I am thinking it may be a better idea to get a Fortran compiler, make a basic program and then see if I can link into this somehow?? :confused:

regards,

Matt
 
Back
Top Bottom