Im doing a project in which im including an already done program.
It has a .bat file as well as a .exe file.
Now the already done progream is in a folder ‘X’ where there are many files including
- is a .tcl file
- is a .exe file
- is a .bat file.
now the when i click the .exe file it opens a dialogue box where i have to select the above mentioned .tcl file and the program executes.
now when i execute the .bat file the program executes automatically.
Now the problem is that all the files are inside a same folder. If i keep the .bat file or the .exe file out of the folder ‘X’ my already done program doesnt execute.
Now im doing a project where i have to call this so called already done program.
Im calling the .bat file or the .exe file. Inside the program using
Process.Start(@"E:\X\abc.exe");
or
Process.Start(@"E:\X\xyz.bat");
but my program doesnt execute.
so i added the whole folder ‘X’ inside my projects and tried this.
Process.Start(@"E:\Project\X\abc.exe");
or
Process.Start(@"E:\Project\X\xyz.bat");
where project is the folder where my projects get saved. Also note im using windows application.
both ways i dont get result.
I have kept the process.start for the button click event.
During the button click if i have
Process.Start(@"E:\Project\X\xyz.bat");
i get blink of the cmd prompt and nothing happens.
when i have
Process.Start(@"E:\Project\X\abc.exe");
i get the dialog box that i mentioned above. And i have to select the .tct file that i mentioned above.
But i get an error like this.
couldn’t open “./input-background.gif”: no such file or directory
Is there a solution where i can run my program incluidng teh .bat file or the .exe file.
actually I think may be there has some confuse problem in your scenario, so I will post a typical calling bat program here:
and you could replace Your batch file with an executable file or a batch file.
About your second problem, may be there has some resource in your batch file get a directory with a space in it, your could add quota around it.
I suggest you could test your batch file in windows command line first, and if it works as expected, then turn to the Process code.
Hope help.