Forum > Beginners

ExecuteProcess aborts the procedure [Solved]

(1/1)

lillaCW:
Who can help me?
ExecuteProcess aborts the procedure
I am trying to start the VPN client from ShrewSoft via a button.
I read in the user name and password from an InI file.
This works quite well.
But after starting ShrewSoft the procedure aborts.
Although I have searched a lot, I cannot find the error.
Thanks


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);begin  ShowMessage('Test1');    ExecuteProcess('C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe','-r ' + VAccessName + ' -u ' + VUserName + ' -p ' + VPasswort + ' -a');                       !! anything below this will be cancelled !!   ShowMessage('Test2'); end;   

bobby100:
It does not abort/cancel.

ExecuteProcess will start your program and wait for it to close. The next line in your code will be executed after your external program ends/closes.

EDIT: for more info about the possibilities, take a look here: https://wiki.freepascal.org/Executing_External_Programs

lillaCW:
Great  ... thank you.
I did not know that.
I have now taken TProcess, so it works.
LillaCW  ;D

lillaCW:
Sorry ...
How can I mark the problem as solved?

MarkMLl:

--- Quote from: lillaCW on May 03, 2022, 10:35:00 am ---Sorry ...
How can I mark the problem as solved?

--- End quote ---

Just edit the subject line of your original posting and put
--- Code: ---[Solved]
--- End code ---
at the start.

https://wiki.freepascal.org/Forum#Mark_a_thread_as_resolved

Crude but effective :-)

MarkMLl

Navigation

[0] Message Index

Go to full version