Recent

Author Topic: ExecuteProcess aborts the procedure [Solved]  (Read 510 times)

lillaCW

  • Newbie
  • Posts: 3
ExecuteProcess aborts the procedure [Solved]
« on: May 02, 2022, 05:57:13 pm »
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  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   ShowMessage('Test1');
  4.    ExecuteProcess('C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe','-r ' + VAccessName + ' -u ' + VUserName + ' -p ' + VPasswort + ' -a');                      
  5.  !! anything below this will be cancelled !!
  6.   ShowMessage('Test2');
  7. end;
  8.  
  9.  
« Last Edit: May 04, 2022, 08:58:51 am by lillaCW »

bobby100

  • Full Member
  • ***
  • Posts: 100
    • Malzilla
Re: ExecuteProcess aborts the procedure
« Reply #1 on: May 02, 2022, 06:39:46 pm »
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
« Last Edit: May 02, 2022, 06:47:57 pm by bobby100 »
https://gitlab.com/bobby100 - my Lazarus components and units
https://sourceforge.net/u/boban_spasic/profile/ - my open source apps

https://malzilla.org/ - remainder at my previous life as a web security expert

lillaCW

  • Newbie
  • Posts: 3
Re: ExecuteProcess aborts the procedure
« Reply #2 on: May 02, 2022, 11:25:19 pm »
Great  ... thank you.
I did not know that.
I have now taken TProcess, so it works.
LillaCW  ;D

lillaCW

  • Newbie
  • Posts: 3
Re: ExecuteProcess aborts the procedure
« Reply #3 on: May 03, 2022, 10:35:00 am »
Sorry ...
How can I mark the problem as solved?

MarkMLl

  • Hero Member
  • *****
  • Posts: 4693
Re: ExecuteProcess aborts the procedure
« Reply #4 on: May 03, 2022, 10:51:24 am »
Sorry ...
How can I mark the problem as solved?

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

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

Crude but effective :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018