0
Unfortunatley still not working: i tried Insert(1,"1")
also tired both after one another:
p.StartInfo.Arguments.Insert(0, str);
p.StartInfo.Arguments.Insert(1, "1");
could it be that the program i'm calling does not have arguments setup:
public frmWAREH004S() {
??
0
what are you doing.
you are inserting arguments in a list so it should be like
Insert(0,str);
Insert(1,"1"); two statements one after another.
args is a collection of arguments
in the end it will execute like this-- programname "arg1" "arg2".
I hope you get it this time.
0
Hi,
I got it to pass the arguments by removing the insert: p.StartInfo.Arguments = str + @" 1";
The problem i now have is that it calls the login frm the first frm & the same frm my current one has already completed.
I would like to bypass the login load frm and go straight to the Main frm of the other program!
??
0
:( no luck
string str = @"i:\\app\\test\\WAREH004.ini";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"i:\\app\\test\\WAREH004.exe";
p.StartInfo.Arguments.Insert(1, "1");
p.Start();
I tried: Insert(0, "1"); Insert(0, "1" + str); Insert(1, "1" + str); Insert(0, str + " 1");
if i put a break and i pass the insert i can see the arguments are blank
0
It seems pretty obvious to me..
just insert another argument
Insert(1,"1");
and don't add "1" after the .ini filename. I think that's what you are doing.
and please mark as answered if you get it this time. :)
0
I'm gratefull for your help - please don't give up.
Unsuccessfull, the 0 index opens only the exe & if i put the 1 in then i get the same error as previous.
string str = @"i:\\app\\test\\WAREH004.ini";
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"i:\\app\\test\\WAREH004.exe";
p.StartInfo.Arguments.Insert(0, str);
p.Start();
0
index starts from 0 and you have entered 1.
besides you can use a string variable
string str=@"......filename.ini";
and pass string in insert
Insert(0,str)
0
I added the @ but when I call the program i get the error:
{"Index was out of range. Must be non-negative and less than the size of the collection.\r\nParameter name: startIndex"}
0
please specify error, or at least type and nature of error.
btw in this code-
p.StartInfo.Arguments.Insert( 1, "i:\\app\\test\\WAREH004.ini");
|
once again you forgot to specify verbatim @
"i:\\app\\test\\WAREH004.ini"
0
Hi, Not winning - still does not work!
p.StartInfo.FileName = @"i:\\app\\test\\WAREH004.exe";
p.StartInfo.Arguments.Insert( 1, "i:\\app\\test\\WAREH004.ini");
The other problem is that this would take me to the startup from of the other program & want to bypass this startup frm because it is the same statup frm of the current application & pass the value I selected on the current startup frm to the other program?
Please Help?
0
hey
try and understand..
"i:\\app\\test\\WAREH004.exe i:\\app\\test\\WAREH004.ini 1" is not a filename
it looks like dos command rather
you will have to specify "i:\\app\\test\\WAREH004.exe" as filename and insert 2 arguments using insert method of the Process.Args
for "i:\\app\\test\\WAREH004.ini" and "1".
I hope i'm clear now.
0
The app gets loaded with ini parameter of 1 and if i run the exe only it does not work & the below method it does not find the file again: Please Help
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"i:\\app\\test\\WAREH004.exe i:\\app\\test\\WAREH004.ini 1";
p.StartInfo.Arguments.Insert(0, txtSite.Text);
p.Start();
0
hey ic ic,
what are you doing here:
p.StartInfo.FileName = "i:\\app\\test\\WAREH004.exe" +
" i:\\app\\test\\WAREH004.INI" + " 1";
|
you should add just one filename and that too of an executable. And please use verbatim before a string with special characters.
p.StartInfo.FileName = @"i:\\app\\test\\WAREH004.exe";
|
0
Thank You for Helping.
I cant seem to get the file location working on this method:
//string root = Application.StartupPath;
//string exePath = System.IO.Path.Combine(root, "i:\\app\\test\\WAREH004.exe");
//string argPath = System.IO.Path.Combine(root, "i:\\app\\test\\WAREH004.INI");
//Process.Start(exePath, argPath + " 1");
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "i:\\app\\test\\WAREH004.exe" + " i:\\app\\test\\WAREH004.INI" + " 1";
p.StartInfo.Arguments.Insert(0, txtSite.Text);
p.Start();
0
hey ic ic,
here is one way.
System.Diagnostics.Process p = new System.Diagnostics.Process(); p.StartInfo.FileName = "your path goes here"; p.StartInfo.Arguments.Insert(0, "dlfsd"); p.Start();
|
0
Please Help - I would like to get this going any ideas!
Reall yapprecaite any help - because I'm searching all over the net for solutions :)
0
Some code examples please on how & what i can try?
public frmWAREH010() - Also has no arguments!
0
well you can just start working with command line arguments and pass the information you need via args[]
and if so load the form based on the args information
the exe has on Program.cs on the Main Method args in the method signature
check if its not empty and if so work with the information in it