I need to run a .bat file that I've previously generated with my program. I also need to run this batch file specifically on the system32/cmd.exe with the attributes "/k fdsinit". Any other ways of running this batch file get errors.
Could anyone help me? Thanks a lot. Best regards
First try:
Process.Start("C:\Windows\System32\cmd.exe", "/k fdsinit"" ""cd " + Label6.Text + " ""mpiexec -n " + np.ToString() + " fds " + Label5.Text)
The commands contained in the string "cd ..." "mpiexec...." "fds...." are contained in the psi.Filename reference in the next tryout.
Second try:
Dim psi As New System.Diagnostics.ProcessStartInfo()
psi.Arguments = "C:\Windows\System32\cmd.exe /k fdsinit"
psi.FileName = Label6.Text + "_runfds.bat"
Dim prc As New System.Diagnostics.Process()
prc.StartInfo = psi
prc.Start()
EDIT
Following @Compo's comment, I've tried:
Dim psi As New System.Diagnostics.ProcessStartInfo()
psi.Arguments = "%ProgramFiles%\FireModels\FDS\bin\fdsinit.bat"
psi.FileName = Label6.Text + "_runfds.bat"
Dim prc As New System.Diagnostics.Process()
prc.StartInfo = psi
prc.Start()
Then I get once again the abovementioned algorhytm error (@Compo it's an hydra error, if you're familiar with FDS). I confirm you that I don't need the cd command, since the filename itself contains the full path of the batch file (Label6.text.....).
Thanks a lot to all will contribute!