Watch, Follow, &
Connect with Us

Please visit our new home
community.embarcadero.com.


Welcome, Guest
Guest Settings
Help

Thread: how to start DosCommand1 untill finish then start DosCommand2 w/o sleep(*);


This question is answered.


Permlink Replies: 1 - Last Post: Feb 13, 2016 11:46 AM Last Post By: Pascal Willener Threads: [ Previous | Next ]
Guest
how to start DosCommand1 untill finish then start DosCommand2 w/o sleep(*);
Click to report abuse...   Click to reply to this thread Reply
  Posted: Aug 30, 2015 4:40 AM
hello sir,
I am writing simple App, then I do not know to start DosCommand1 untill finish then start DosCommand2 w/o sleep(*);
I will be very happy if you help me

DosCommand01.CommandLine:='plink -ssh -C -s -N -D 1 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand01.Execute;
sleep (5);
DosCommand02.CommandLine:='plink -ssh -C -s -N -D 2 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand02.Execute;
sleep (5);
DosCommand03.CommandLine:='plink -ssh -C -s -N -D 3 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand03.Execute;


**sorry for my bad english
Pascal Willener

Posts: 36
Registered: 5/15/14
Re: how to start DosCommand1 untill finish then start DosCommand2 w/o sleep(*);
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 13, 2016 11:46 AM   in response to: Guest in response to: Guest
Adam Smith wrote:
hello sir,
I am writing simple App, then I do not know to start DosCommand1 untill finish then start DosCommand2 w/o sleep(*);
I will be very happy if you help me

DosCommand01.CommandLine:='plink -ssh -C -s -N -D 1 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand01.Execute;
sleep (5);
DosCommand02.CommandLine:='plink -ssh -C -s -N -D 2 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand02.Execute;
sleep (5);
DosCommand03.CommandLine:='plink -ssh -C -s -N -D 3 -v '+SSHUsername.Text+'@'+SSHHost.Text+ ' -P ' +SSHPort.Text+' -pw '+SSHPassword.Text;
DosCommand03.Execute;


**sorry for my bad english

Start your next command in the OnTerminated event and not right after the Execute...
DosCommand starts in a separate Thread and will not block the code flow...
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02